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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: D = None
        self.s: F = None
        self.t: D = None
        self.txt = txt

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

c = A("c")
i = B("i")
a = C("a")
k = D("k")
b = E("b")
m = F("m")

c.o = k
i.o = m
a.v = k
a.x = b
k.z = a
k.w = i
b.u = a
b.r = k
b.t = k
b.s = m
m.u = a
assert c.o.w.o.u.x.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: D = None
        self.s: F = None
        self.t: D = None
        self.txt = txt

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

c = A("c")
i = B("i")
a = C("a")
k = D("k")
b = E("b")
m = F("m")

c.o = k
i.o = m
a.v = k
a.x = b
k.z = a
k.w = i
b.u = a
b.r = k
b.t = k
b.s = m
m.u = a
assert c.o.w.o.u.x.txt == "b"