class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: B = None
        self.v: D = None
        self.r: D = None
        self.p: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: C = None
        self.v: C = None
        self.w: F = None
        self.z: D = None
        self.txt = txt

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

a = A("a")
f = B("f")
e = C("e")
k = D("k")
j = E("j")
h = F("h")
l = C("l")
d = D("d")
b = F("b")

a.y = h
a.p = h
a.s = f
a.v = d
a.r = k
f.s = j
f.z = b
f.u = d
f.x = e
e.t = d
e.r = a
e.v = a
k.o = b
k.x = f
j.r = b
j.y = l
j.v = e
j.w = h
j.z = k
h.t = e
h.u = e
h.p = e
h.q = k
l.t = d
l.r = a
l.v = a
d.o = b
d.x = f
b.t = l
b.p = l
b.u = e
b.q = d
assert e.r.v.o.q.o.q.txt == "
class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: B = None
        self.v: D = None
        self.r: D = None
        self.p: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: C = None
        self.v: C = None
        self.w: F = None
        self.z: D = None
        self.txt = txt

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

a = A("a")
f = B("f")
e = C("e")
k = D("k")
j = E("j")
h = F("h")
l = C("l")
d = D("d")
b = F("b")

a.y = h
a.p = h
a.s = f
a.v = d
a.r = k
f.s = j
f.z = b
f.u = d
f.x = e
e.t = d
e.r = a
e.v = a
k.o = b
k.x = f
j.r = b
j.y = l
j.v = e
j.w = h
j.z = k
h.t = e
h.u = e
h.p = e
h.q = k
l.t = d
l.r = a
l.v = a
d.o = b
d.x = f
b.t = l
b.p = l
b.u = e
b.q = d
assert e.r.v.o.q.o.q.txt == "d"