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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: D = None
        self.t: A = None
        self.w: A = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: D = None
        self.t: A = None
        self.w: A = None
        self.txt = txt

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

f.r = h
f.u = g
f.w = m
m.q = l
m.r = k
m.o = k
m.u = c
m.w = h
m.p = g
j.t = d
j.o = m
g.z = l
g.o = k
k.v = h
k.z = l
k.t = l
k.y = m
k.p = m
k.q = m
l.z = d
l.p = g
l.t = f
l.w = f
d.v = f
d.z = l
d.t = l
d.y = m
d.p = m
d.q = m
c.t = d
c.o = m
a.z = l
a.o = k
h.r = f
h.u = g
h.w = m
assert g.o.p.w.txt == "h"