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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: H = None
        self.r: A = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: E = None
        self.w: E = None
        self.t: H = None
        self.x: E = None
        self.p: G = None
        self.q: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.z: E = None
        self.v: G = None
        self.s: B = None
        self.txt = txt

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

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

a = A("a")
d = B("d")
m = C("m")
f = D("f")
g = E("g")
l = F("l")
j = G("j")
k = H("k")
n = D("n")

a.r = g
a.x = g
a.w = l
a.u = d
d.z = a
d.r = a
d.t = k
d.s = m
m.r = a
m.z = g
m.w = g
m.x = g
m.t = k
m.p = j
m.q = d
f.z = d
f.o = n
g.o = f
g.p = f
g.s = a
l.x = k
l.z = g
l.v = j
l.s = d
j.p = g
k.u = g
k.o = m
k.z = l
n.z = d
n.o = f
assert d.z.r.p.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: F = None
        self.x: E = None
        self.u: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: H = None
        self.r: A = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: E = None
        self.w: E = None
        self.t: H = None
        self.x: E = None
        self.p: G = None
        self.q: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.z: E = None
        self.v: G = None
        self.s: B = None
        self.txt = txt

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

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

a = A("a")
d = B("d")
m = C("m")
f = D("f")
g = E("g")
l = F("l")
j = G("j")
k = H("k")
n = D("n")

a.r = g
a.x = g
a.w = l
a.u = d
d.z = a
d.r = a
d.t = k
d.s = m
m.r = a
m.z = g
m.w = g
m.x = g
m.t = k
m.p = j
m.q = d
f.z = d
f.o = n
g.o = f
g.p = f
g.s = a
l.x = k
l.z = g
l.v = j
l.s = d
j.p = g
k.u = g
k.o = m
k.z = l
n.z = d
n.o = f
assert d.z.r.p.o.o.txt == "f"