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

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.y: D = None
        self.txt = txt

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

a = A("a")
d = B("d")
g = C("g")
n = D("n")
l = E("l")
b = F("b")

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.y: D = None
        self.txt = txt

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

a = A("a")
d = B("d")
g = C("g")
n = D("n")
l = E("l")
b = F("b")

a.z = n
a.y = n
a.s = g
a.v = g
a.t = l
d.r = l
g.z = l
g.t = b
g.o = n
g.s = d
n.o = l
l.q = b
l.y = n
b.q = d
b.t = d
b.u = a
b.o = l
assert b.t.r.y.o.y.txt == "n"