class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: G = None
        self.p: G = None
        self.r: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: D = None
        self.z: F = None
        self.w: G = None
        self.s: B = None
        self.y: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.y: F = None
        self.w: F = None
        self.r: A = None
        self.v: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: D = None
        self.z: F = None
        self.w: G = None
        self.s: B = None
        self.y: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.y: F = None
        self.w: F = None
        self.r: A = None
        self.v: D = None
        self.txt = txt

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

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