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

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

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: F = None
        self.x: E = None
        self.y: B = None
        self.txt = txt

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

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

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

k.t = a
n.z = a
n.o = a
n.t = k
a.y = l
a.t = h
a.r = k
l.z = j
l.o = j
l.x = f
l.y = n
f.t = n
f.x = j
f.p = k
j.q = h
j.v = f
i.t = n
i.x = j
i.p = k
h.z = j
h.o = j
h.x = i
h.y = n
d.t = n
d.x = j
d.p = k
assert h.x.p.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: F = None
        self.x: E = None
        self.y: B = None
        self.txt = txt

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

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

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

k.t = a
n.z = a
n.o = a
n.t = k
a.y = l
a.t = h
a.r = k
l.z = j
l.o = j
l.x = f
l.y = n
f.t = n
f.x = j
f.p = k
j.q = h
j.v = f
i.t = n
i.x = j
i.p = k
h.z = j
h.o = j
h.x = i
h.y = n
d.t = n
d.x = j
d.p = k
assert h.x.p.t.txt == "a"