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

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: B = None
        self.txt = txt

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

b = A("b")
i = B("i")
a = C("a")
d = D("d")
l = E("l")
j = F("j")

b.u = a
i.u = b
i.t = b
i.y = l
a.q = d
a.v = b
a.o = j
d.t = a
l.u = i
l.v = i
j.x = b
j.o = b
j.r = a
assert a.q.t.o.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: B = None
        self.txt = txt

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

b = A("b")
i = B("i")
a = C("a")
d = D("d")
l = E("l")
j = F("j")

b.u = a
i.u = b
i.t = b
i.y = l
a.q = d
a.v = b
a.o = j
d.t = a
l.u = i
l.v = i
j.x = b
j.o = b
j.r = a
assert a.q.t.o.txt == "j"