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

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

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: C = None
        self.p: C = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: C = None
        self.p: C = None
        self.txt = txt

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

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

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