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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: D = None
        self.z: C = None
        self.p: E = None
        self.txt = txt

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

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

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

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

b = A("b")
j = B("j")
c = C("c")
n = D("n")
k = E("k")
f = F("f")
h = D("h")
e = F("e")
l = C("l")
m = C("m")

b.y = l
j.v = b
j.x = n
j.z = c
j.p = k
c.o = f
n.z = k
n.w = c
k.w = b
k.t = j
k.s = j
k.x = e
f.w = n
f.o = e
h.z = k
h.w = l
e.w = n
e.o = f
l.o = f
m.o = f
assert c.o.w.w.o.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: D = None
        self.z: C = None
        self.p: E = None
        self.txt = txt

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

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

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

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

b = A("b")
j = B("j")
c = C("c")
n = D("n")
k = E("k")
f = F("f")
h = D("h")
e = F("e")
l = C("l")
m = C("m")

b.y = l
j.v = b
j.x = n
j.z = c
j.p = k
c.o = f
n.z = k
n.w = c
k.w = b
k.t = j
k.s = j
k.x = e
f.w = n
f.o = e
h.z = k
h.w = l
e.w = n
e.o = f
l.o = f
m.o = f
assert c.o.w.w.o.o.o.txt == "f"