class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.z: C = None
        self.r: D = None
        self.u: D = None
        self.q: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: E = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: F = None
        self.p: D = None
        self.q: E = None
        self.o: A = None
        self.r: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: E = None
        self.q: C = None
        self.r: A = None
        self.u: E = None
        self.txt = txt

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

c.y = f
c.z = a
c.q = a
c.r = l
c.u = l
f.r = i
f.v = i
f.x = c
f.z = d
f.t = b
f.s = a
a.o = f
a.s = d
a.p = d
b.x = l
b.p = l
b.v = i
b.r = i
b.q = d
b.o = c
d.x = f
d.q = f
d.p = l
i.z = d
i.y = d
i.u = d
i.q = a
i.r = c
l.x = b
l.p = b
l.v = i
l.r = i
l.q = d
l.o = c
assert a.o.t.p.o.y.t.o.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.z: C = None
        self.r: D = None
        self.u: D = None
        self.q: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: E = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: F = None
        self.p: D = None
        self.q: E = None
        self.o: A = None
        self.r: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: E = None
        self.q: C = None
        self.r: A = None
        self.u: E = None
        self.txt = txt

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

c.y = f
c.z = a
c.q = a
c.r = l
c.u = l
f.r = i
f.v = i
f.x = c
f.z = d
f.t = b
f.s = a
a.o = f
a.s = d
a.p = d
b.x = l
b.p = l
b.v = i
b.r = i
b.q = d
b.o = c
d.x = f
d.q = f
d.p = l
i.z = d
i.y = d
i.u = d
i.q = a
i.r = c
l.x = b
l.p = b
l.v = i
l.r = i
l.q = d
l.o = c
assert a.o.t.p.o.y.t.o.txt == "c"