class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.t: C = None
        self.v: C = None
        self.s: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.s: A = None
        self.txt = txt

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

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

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

h.z = b
h.t = b
h.v = b
h.s = d
n.t = l
n.o = l
b.r = h
b.t = j
b.v = n
l.z = b
l.s = h
f.q = e
d.u = n
e.q = a
a.q = f
j.t = l
j.o = l
assert b.r.t.v.t.s.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.t: C = None
        self.v: C = None
        self.s: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.s: A = None
        self.txt = txt

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

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

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

h.z = b
h.t = b
h.v = b
h.s = d
n.t = l
n.o = l
b.r = h
b.t = j
b.v = n
l.z = b
l.s = h
f.q = e
d.u = n
e.q = a
a.q = f
j.t = l
j.o = l
assert b.r.t.v.t.s.txt == "h"