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

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

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

i = A("i")
l = B("l")
e = C("e")
j = A("j")
c = A("c")
b = B("b")

i.u = b
i.q = e
i.o = j
l.z = e
l.v = b
l.x = i
e.x = i
e.r = c
j.u = l
j.q = e
j.o = c
c.u = l
c.q = e
c.o = j
b.z = e
b.v = l
b.x = j
assert i.u.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: C = None
        self.o: A = None
        self.txt = txt

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

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

i = A("i")
l = B("l")
e = C("e")
j = A("j")
c = A("c")
b = B("b")

i.u = b
i.q = e
i.o = j
l.z = e
l.v = b
l.x = i
e.x = i
e.r = c
j.u = l
j.q = e
j.o = c
c.u = l
c.q = e
c.o = j
b.z = e
b.v = l
b.x = j
assert i.u.v.v.txt == "b"