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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: F = None
        self.u: C = None
        self.q: D = None
        self.o: E = None
        self.w: F = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.t: B = None
        self.q: F = None
        self.o: D = None
        self.y: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: E = None
        self.q: E = None
        self.v: B = None
        self.o: B = None
        self.w: E = None
        self.r: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: B = None
        self.o: A = None
        self.txt = txt

f = A("f")
m = B("m")
c = C("c")
k = D("k")
d = E("d")
h = F("h")
e = G("e")
b = A("b")
g = E("g")

f.t = m
m.s = d
m.o = d
m.x = h
m.w = h
m.u = c
m.q = k
m.p = k
c.u = e
c.t = m
c.y = m
c.q = h
c.o = k
k.y = e
k.r = g
d.w = h
d.z = f
d.p = c
h.z = k
h.s = d
h.q = g
h.w = g
h.v = m
h.o = m
h.r = b
e.q = k
e.z = m
e.o = b
b.t = m
g.w = h
g.z = f
g.p = c
assert g.w.w.w.z.y.q.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: F = None
        self.u: C = None
        self.q: D = None
        self.o: E = None
        self.w: F = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.t: B = None
        self.q: F = None
        self.o: D = None
        self.y: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: E = None
        self.q: E = None
        self.v: B = None
        self.o: B = None
        self.w: E = None
        self.r: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: B = None
        self.o: A = None
        self.txt = txt

f = A("f")
m = B("m")
c = C("c")
k = D("k")
d = E("d")
h = F("h")
e = G("e")
b = A("b")
g = E("g")

f.t = m
m.s = d
m.o = d
m.x = h
m.w = h
m.u = c
m.q = k
m.p = k
c.u = e
c.t = m
c.y = m
c.q = h
c.o = k
k.y = e
k.r = g
d.w = h
d.z = f
d.p = c
h.z = k
h.s = d
h.q = g
h.w = g
h.v = m
h.o = m
h.r = b
e.q = k
e.z = m
e.o = b
b.t = m
g.w = h
g.z = f
g.p = c
assert g.w.w.w.z.y.q.txt == "k"