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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: F = None
        self.t: F = None
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: A = None
        self.q: F = None
        self.p: B = None
        self.v: D = None
        self.r: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: A = None
        self.y: C = None
        self.t: F = None
        self.z: F = None
        self.u: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: F = None
        self.t: F = None
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: A = None
        self.q: F = None
        self.p: B = None
        self.v: D = None
        self.r: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: A = None
        self.y: C = None
        self.t: F = None
        self.z: F = None
        self.u: E = None
        self.txt = txt

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

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

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