class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: E = None
        self.q: E = None
        self.v: D = None
        self.z: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: B = None
        self.v: A = None
        self.u: A = None
        self.txt = txt

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

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

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

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

b = A("b")
c = B("c")
n = C("n")
d = D("d")
i = E("i")
j = F("j")
e = E("e")
h = D("h")
m = B("m")
l = F("l")

b.r = l
b.y = i
b.q = e
b.v = d
b.z = h
c.y = e
c.s = m
c.v = b
c.u = b
n.p = c
n.t = d
n.q = b
d.t = h
i.u = b
j.y = c
e.u = b
h.t = d
m.y = e
m.s = c
m.v = b
m.u = b
l.y = c
assert d.t.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: E = None
        self.q: E = None
        self.v: D = None
        self.z: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: B = None
        self.v: A = None
        self.u: A = None
        self.txt = txt

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

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

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

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

b = A("b")
c = B("c")
n = C("n")
d = D("d")
i = E("i")
j = F("j")
e = E("e")
h = D("h")
m = B("m")
l = F("l")

b.r = l
b.y = i
b.q = e
b.v = d
b.z = h
c.y = e
c.s = m
c.v = b
c.u = b
n.p = c
n.t = d
n.q = b
d.t = h
i.u = b
j.y = c
e.u = b
h.t = d
m.y = e
m.s = c
m.v = b
m.u = b
l.y = c
assert d.t.t.t.txt == "h"