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

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: H = None
        self.q: A = None
        self.x: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: C = None
        self.y: C = None
        self.w: H = None
        self.r: C = None
        self.x: C = None
        self.o: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: C = None
        self.q: B = None
        self.o: G = None
        self.txt = txt

a = A("a")
k = B("k")
d = C("d")
b = D("b")
j = E("j")
f = F("f")
e = G("e")
m = H("m")

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

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: H = None
        self.q: A = None
        self.x: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: C = None
        self.y: C = None
        self.w: H = None
        self.r: C = None
        self.x: C = None
        self.o: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: C = None
        self.q: B = None
        self.o: G = None
        self.txt = txt

a = A("a")
k = B("k")
d = C("d")
b = D("b")
j = E("j")
f = F("f")
e = G("e")
m = H("m")

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