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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: F = None
        self.y: F = None
        self.t: C = None
        self.u: A = None
        self.txt = txt

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

d = A("d")
h = B("h")
c = C("c")
l = D("l")
a = E("a")
n = F("n")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: F = None
        self.y: F = None
        self.t: C = None
        self.u: A = None
        self.txt = txt

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

d = A("d")
h = B("h")
c = C("c")
l = D("l")
a = E("a")
n = F("n")

d.r = c
d.z = c
d.s = a
d.t = a
d.w = l
h.u = n
h.p = l
h.y = l
h.w = l
h.r = c
h.z = d
c.x = n
c.z = n
c.s = d
l.y = d
l.p = d
l.r = c
l.v = c
l.z = c
l.s = a
a.s = c
a.t = c
a.o = n
a.y = n
a.u = d
n.r = c
n.q = c
n.o = d
n.z = a
assert a.t.s.s.s.txt == "c"