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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.u: C = None
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: C = None
        self.q: E = None
        self.w: D = None
        self.r: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: D = None
        self.x: C = None
        self.txt = txt

l = A("l")
i = B("i")
g = C("g")
h = D("h")
c = E("c")
j = F("j")
m = A("m")
k = D("k")
n = A("n")
d = E("d")

l.y = m
l.z = n
l.s = h
i.v = c
i.u = g
i.z = n
g.w = j
h.x = d
h.o = g
h.q = c
h.w = k
h.r = i
c.r = l
c.v = g
c.q = g
c.z = g
c.o = j
c.s = i
j.y = h
j.w = k
j.x = g
m.y = l
m.z = n
m.s = h
k.x = d
k.o = g
k.q = c
k.w = h
k.r = i
n.y = l
n.z = l
n.s = h
d.r = l
d.v = g
d.q = g
d.z = g
d.o = j
d.s = i
assert d.s.z.s.o.w.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: A = None
        self.s: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.u: C = None
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: C = None
        self.q: E = None
        self.w: D = None
        self.r: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: D = None
        self.x: C = None
        self.txt = txt

l = A("l")
i = B("i")
g = C("g")
h = D("h")
c = E("c")
j = F("j")
m = A("m")
k = D("k")
n = A("n")
d = E("d")

l.y = m
l.z = n
l.s = h
i.v = c
i.u = g
i.z = n
g.w = j
h.x = d
h.o = g
h.q = c
h.w = k
h.r = i
c.r = l
c.v = g
c.q = g
c.z = g
c.o = j
c.s = i
j.y = h
j.w = k
j.x = g
m.y = l
m.z = n
m.s = h
k.x = d
k.o = g
k.q = c
k.w = h
k.r = i
n.y = l
n.z = l
n.s = h
d.r = l
d.v = g
d.q = g
d.z = g
d.o = j
d.s = i
assert d.s.z.s.o.w.y.txt == "h"