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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: B = None
        self.z: E = None
        self.w: D = None
        self.r: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: C = None
        self.p: C = None
        self.x: G = None
        self.u: C = None
        self.r: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: E = None
        self.s: B = None
        self.r: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: B = None
        self.z: E = None
        self.w: D = None
        self.r: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: C = None
        self.p: C = None
        self.x: G = None
        self.u: C = None
        self.r: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: E = None
        self.s: B = None
        self.r: B = None
        self.txt = txt

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

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