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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: C = None
        self.t: E = None
        self.s: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: C = None
        self.t: E = None
        self.s: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

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

g.r = i
g.z = d
g.t = b
i.y = a
i.w = n
i.t = f
i.s = f
n.r = i
n.q = d
n.u = d
b.u = g
f.z = i
f.s = i
f.o = n
f.q = n
d.x = b
d.o = b
d.v = i
d.q = g
a.r = i
a.z = d
a.t = b
assert n.u.o.u.z.v.y.txt == "a"