class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: D = None
        self.x: D = None
        self.q: F = None
        self.t: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: A = None
        self.x: C = None
        self.v: E = None
        self.p: B = None
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: C = None
        self.r: A = None
        self.q: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: A = None
        self.x: C = None
        self.v: E = None
        self.p: B = None
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: C = None
        self.r: A = None
        self.q: E = None
        self.txt = txt

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

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