class A:
    def __init__(self, txt: str):
        self.t: H = None
        self.v: G = None
        self.z: B = None
        self.r: B = None
        self.o: H = None
        self.w: E = None
        self.p: G = None
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: H = None
        self.r: C = None
        self.q: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.p: H = None
        self.t: C = None
        self.o: G = None
        self.q: H = None
        self.r: G = None
        self.v: E = None
        self.u: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.t: F = None
        self.o: B = None
        self.q: C = None
        self.w: C = None
        self.z: C = None
        self.u: F = None
        self.p: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: G = None
        self.x: E = None
        self.u: B = None
        self.q: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: A = None
        self.txt = txt

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

a = A("a")
b = B("b")
i = C("i")
j = D("j")
m = E("m")
l = F("l")
c = G("c")
h = H("h")
k = H("k")

a.t = k
a.v = c
a.p = c
a.z = b
a.r = b
a.o = h
a.w = m
a.y = i
b.u = h
b.q = h
b.r = i
i.o = a
i.p = a
i.v = a
i.q = l
j.z = l
j.p = h
j.q = h
j.t = i
j.o = c
j.r = c
j.v = m
j.u = a
m.x = b
m.o = b
m.t = l
m.u = l
m.q = i
m.w = i
m.z = i
m.p = k
l.s = m
l.x = m
l.p = c
l.u = b
l.q = a
c.r = b
c.p = a
h.q = k
k.q = h
assert h.q.q.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.t: H = None
        self.v: G = None
        self.z: B = None
        self.r: B = None
        self.o: H = None
        self.w: E = None
        self.p: G = None
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: H = None
        self.r: C = None
        self.q: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.p: H = None
        self.t: C = None
        self.o: G = None
        self.q: H = None
        self.r: G = None
        self.v: E = None
        self.u: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.t: F = None
        self.o: B = None
        self.q: C = None
        self.w: C = None
        self.z: C = None
        self.u: F = None
        self.p: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: G = None
        self.x: E = None
        self.u: B = None
        self.q: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: A = None
        self.txt = txt

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

a = A("a")
b = B("b")
i = C("i")
j = D("j")
m = E("m")
l = F("l")
c = G("c")
h = H("h")
k = H("k")

a.t = k
a.v = c
a.p = c
a.z = b
a.r = b
a.o = h
a.w = m
a.y = i
b.u = h
b.q = h
b.r = i
i.o = a
i.p = a
i.v = a
i.q = l
j.z = l
j.p = h
j.q = h
j.t = i
j.o = c
j.r = c
j.v = m
j.u = a
m.x = b
m.o = b
m.t = l
m.u = l
m.q = i
m.w = i
m.z = i
m.p = k
l.s = m
l.x = m
l.p = c
l.u = b
l.q = a
c.r = b
c.p = a
h.q = k
k.q = h
assert h.q.q.q.q.txt == "h"