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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: C = None
        self.r: F = None
        self.y: F = None
        self.q: C = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: A = None
        self.z: F = None
        self.u: F = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: G = None
        self.o: E = None
        self.s: G = None
        self.q: B = None
        self.y: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

k = A("k")
d = B("d")
m = C("m")
a = D("a")
c = E("c")
f = F("f")
g = G("g")
j = A("j")
e = C("e")
n = E("n")

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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: C = None
        self.r: F = None
        self.y: F = None
        self.q: C = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: A = None
        self.z: F = None
        self.u: F = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: G = None
        self.o: E = None
        self.s: G = None
        self.q: B = None
        self.y: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

k = A("k")
d = B("d")
m = C("m")
a = D("a")
c = E("c")
f = F("f")
g = G("g")
j = A("j")
e = C("e")
n = E("n")

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