class A:
    def __init__(self, txt: str):
        self.w: A = None
        self.p: D = None
        self.t: B = None
        self.o: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.u: E = None
        self.x: H = None
        self.r: E = None
        self.w: E = None
        self.o: G = None
        self.q: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.o: B = None
        self.t: H = None
        self.q: D = None
        self.s: C = None
        self.z: E = None
        self.p: B = None
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: F = None
        self.v: C = None
        self.q: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.p: B = None
        self.y: G = None
        self.q: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: C = None
        self.s: A = None
        self.q: F = None
        self.u: F = None
        self.y: B = None
        self.w: D = None
        self.txt = txt

i = A("i")
f = B("f")
m = C("m")
c = D("c")
b = E("b")
j = F("j")
l = G("l")
d = H("d")
h = C("h")
a = A("a")

i.w = a
i.o = a
i.p = c
i.t = f
f.v = b
f.u = b
f.r = b
f.w = b
f.x = d
f.o = l
f.q = l
m.x = d
m.t = d
m.o = f
m.p = f
m.q = c
m.w = c
m.s = h
m.z = b
c.x = l
c.u = j
c.v = h
c.q = a
b.z = i
j.x = d
j.q = d
j.p = f
j.y = l
l.o = b
l.x = c
d.v = h
d.z = m
d.s = a
d.q = j
d.u = j
d.y = f
d.w = c
h.x = d
h.t = d
h.o = f
h.p = f
h.q = c
h.w = c
h.s = m
h.z = b
a.w = i
a.o = i
a.p = c
a.t = f
assert b.z.p.v.q.txt == "
class A:
    def __init__(self, txt: str):
        self.w: A = None
        self.p: D = None
        self.t: B = None
        self.o: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.u: E = None
        self.x: H = None
        self.r: E = None
        self.w: E = None
        self.o: G = None
        self.q: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.o: B = None
        self.t: H = None
        self.q: D = None
        self.s: C = None
        self.z: E = None
        self.p: B = None
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: F = None
        self.v: C = None
        self.q: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.p: B = None
        self.y: G = None
        self.q: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: C = None
        self.s: A = None
        self.q: F = None
        self.u: F = None
        self.y: B = None
        self.w: D = None
        self.txt = txt

i = A("i")
f = B("f")
m = C("m")
c = D("c")
b = E("b")
j = F("j")
l = G("l")
d = H("d")
h = C("h")
a = A("a")

i.w = a
i.o = a
i.p = c
i.t = f
f.v = b
f.u = b
f.r = b
f.w = b
f.x = d
f.o = l
f.q = l
m.x = d
m.t = d
m.o = f
m.p = f
m.q = c
m.w = c
m.s = h
m.z = b
c.x = l
c.u = j
c.v = h
c.q = a
b.z = i
j.x = d
j.q = d
j.p = f
j.y = l
l.o = b
l.x = c
d.v = h
d.z = m
d.s = a
d.q = j
d.u = j
d.y = f
d.w = c
h.x = d
h.t = d
h.o = f
h.p = f
h.q = c
h.w = c
h.s = m
h.z = b
a.w = i
a.o = i
a.p = c
a.t = f
assert b.z.p.v.q.txt == "c"