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

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

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: B = None
        self.v: B = None
        self.u: B = None
        self.q: F = None
        self.p: B = None
        self.txt = txt

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

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

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

l.x = j
l.t = j
l.z = j
l.u = a
j.p = l
j.x = l
j.t = f
j.y = f
j.v = m
k.y = f
k.r = n
k.o = n
m.s = k
m.y = f
m.v = f
m.u = f
m.q = n
m.p = j
a.z = n
a.o = j
a.u = k
n.t = a
n.u = a
f.p = l
f.x = l
f.t = j
f.y = j
f.v = m
assert m.p.v.q.t.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.t: B = None
        self.u: E = None
        self.z: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: B = None
        self.v: B = None
        self.u: B = None
        self.q: F = None
        self.p: B = None
        self.txt = txt

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

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

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

l.x = j
l.t = j
l.z = j
l.u = a
j.p = l
j.x = l
j.t = f
j.y = f
j.v = m
k.y = f
k.r = n
k.o = n
m.s = k
m.y = f
m.v = f
m.u = f
m.q = n
m.p = j
a.z = n
a.o = j
a.u = k
n.t = a
n.u = a
f.p = l
f.x = l
f.t = j
f.y = j
f.v = m
assert m.p.v.q.t.txt == "a"