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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: F = None
        self.v: F = None
        self.w: A = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: F = None
        self.v: F = None
        self.w: A = None
        self.txt = txt

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

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

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

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

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

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