class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: D = None
        self.p: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: B = None
        self.txt = txt

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

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: B = None
        self.txt = txt

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

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

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

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

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

d.t = l
d.w = l
d.p = l
j.r = b
j.z = b
j.t = b
j.x = n
j.v = d
j.p = m
j.q = f
j.w = f
f.r = l
l.t = d
l.q = j
e.q = l
e.o = f
e.r = j
e.t = m
e.s = d
n.r = m
n.x = m
n.v = m
n.s = m
n.t = e
n.u = l
n.p = d
n.q = f
m.p = j
b.s = n
assert f.r.q.p.p.r.txt == "b"