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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.y: A = None
        self.z: A = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.y: A = None
        self.z: A = None
        self.u: B = None
        self.txt = txt

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

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

l.p = j
j.w = a
j.x = a
j.t = l
j.o = f
j.v = e
a.u = f
a.y = j
a.o = m
e.o = m
e.x = f
e.t = l
m.p = f
m.y = l
m.z = l
m.u = j
f.s = j
f.y = j
c.u = f
c.y = j
c.o = m
assert j.t.p.v.x.s.txt == "j"