class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.x: E = None
        self.q: B = None
        self.z: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: C = None
        self.p: A = None
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: D = None
        self.u: F = None
        self.txt = txt

m = A("m")
l = B("l")
n = C("n")
k = D("k")
h = E("h")
f = F("f")
a = G("a")
b = E("b")

m.t = h
l.w = a
l.y = h
n.s = b
n.y = f
k.u = m
h.s = a
h.x = b
h.q = l
h.z = l
f.w = n
f.r = n
f.p = m
f.s = b
a.v = n
a.x = k
a.u = f
b.s = a
b.x = h
b.q = l
b.z = l
assert k.u.t.s.v.s.x.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.x: E = None
        self.q: B = None
        self.z: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: C = None
        self.p: A = None
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: D = None
        self.u: F = None
        self.txt = txt

m = A("m")
l = B("l")
n = C("n")
k = D("k")
h = E("h")
f = F("f")
a = G("a")
b = E("b")

m.t = h
l.w = a
l.y = h
n.s = b
n.y = f
k.u = m
h.s = a
h.x = b
h.q = l
h.z = l
f.w = n
f.r = n
f.p = m
f.s = b
a.v = n
a.x = k
a.u = f
b.s = a
b.x = h
b.q = l
b.z = l
assert k.u.t.s.v.s.x.txt == "h"