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

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

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

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: H = None
        self.y: F = None
        self.s: E = None
        self.q: B = None
        self.t: B = None
        self.r: G = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.t: H = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: F = None
        self.o: H = None
        self.z: B = None
        self.v: C = None
        self.w: F = None
        self.p: H = None
        self.u: B = None
        self.txt = txt

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

g = A("g")
k = B("k")
j = C("j")
m = D("m")
n = E("n")
d = F("d")
c = G("c")
b = H("b")

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: H = None
        self.y: F = None
        self.s: E = None
        self.q: B = None
        self.t: B = None
        self.r: G = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.t: H = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: F = None
        self.o: H = None
        self.z: B = None
        self.v: C = None
        self.w: F = None
        self.p: H = None
        self.u: B = None
        self.txt = txt

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

g = A("g")
k = B("k")
j = C("j")
m = D("m")
n = E("n")
d = F("d")
c = G("c")
b = H("b")

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