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

class B:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: D = None
        self.s: F = None
        self.z: D = None
        self.x: F = None
        self.t: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: D = None
        self.s: F = None
        self.z: D = None
        self.x: F = None
        self.t: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: C = None
        self.txt = txt

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

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

b.o = a
f.w = j
f.v = n
f.z = n
f.s = a
f.x = a
f.t = c
l.v = b
n.z = c
n.u = a
c.w = l
c.s = l
a.p = j
j.w = f
j.v = n
j.z = n
j.s = a
j.x = a
j.t = c
assert b.o.p.v.u.txt == "a"