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

class B:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: A = None
        self.q: B = None
        self.txt = txt

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

b = A("b")
d = B("d")
i = C("i")
j = B("j")
f = A("f")

b.t = i
b.u = i
b.o = d
d.s = j
d.q = j
d.v = f
i.u = d
i.t = j
i.x = f
j.s = d
j.q = d
j.v = f
f.t = i
f.u = i
f.o = d
assert b.o.v.t.u.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: C = None
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: A = None
        self.q: B = None
        self.txt = txt

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

b = A("b")
d = B("d")
i = C("i")
j = B("j")
f = A("f")

b.t = i
b.u = i
b.o = d
d.s = j
d.q = j
d.v = f
i.u = d
i.t = j
i.x = f
j.s = d
j.q = d
j.v = f
f.t = i
f.u = i
f.o = d
assert b.o.v.t.u.txt == "d"