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

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

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: E = None
        self.r: B = None
        self.w: C = None
        self.txt = txt

k = A("k")
c = B("c")
f = C("f")
j = D("j")
d = E("d")
e = F("e")
a = E("a")

k.p = f
k.o = f
c.y = e
f.t = d
f.v = c
f.o = e
j.o = c
d.v = j
d.y = j
d.u = f
d.o = f
d.w = k
d.z = e
e.v = d
e.z = a
e.r = c
e.w = f
a.v = j
a.y = j
a.u = f
a.o = f
a.w = k
a.z = e
assert a.o.o.r.y.v.w.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: E = None
        self.r: B = None
        self.w: C = None
        self.txt = txt

k = A("k")
c = B("c")
f = C("f")
j = D("j")
d = E("d")
e = F("e")
a = E("a")

k.p = f
k.o = f
c.y = e
f.t = d
f.v = c
f.o = e
j.o = c
d.v = j
d.y = j
d.u = f
d.o = f
d.w = k
d.z = e
e.v = d
e.z = a
e.r = c
e.w = f
a.v = j
a.y = j
a.u = f
a.o = f
a.w = k
a.z = e
assert a.o.o.r.y.v.w.txt == "k"