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

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

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

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

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

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

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

c.u = f
c.o = f
c.v = j
c.z = j
j.o = f
d.t = i
d.x = c
d.z = j
f.u = n
i.p = f
n.w = f
n.y = j
l.w = f
l.y = j
assert i.p.u.y.o.u.w.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: B = None
        self.z: B = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

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

c.u = f
c.o = f
c.v = j
c.z = j
j.o = f
d.t = i
d.x = c
d.z = j
f.u = n
i.p = f
n.w = f
n.y = j
l.w = f
l.y = j
assert i.p.u.y.o.u.w.txt == "f"