class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.q: B = None
        self.r: E = None
        self.z: C = None
        self.o: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.y: A = None
        self.t: F = None
        self.s: A = None
        self.x: D = None
        self.w: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.y: A = None
        self.t: F = None
        self.s: A = None
        self.x: D = None
        self.w: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

b.u = a
b.q = j
b.r = e
b.o = e
b.z = n
j.t = b
n.t = e
n.x = e
h.t = e
h.x = l
e.p = a
e.t = a
e.y = b
e.s = b
e.x = c
e.w = l
a.u = l
l.t = e
l.x = e
c.t = e
c.x = l
assert j.t.u.u.t.s.q.t.q.txt == "j"