class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: H = None
        self.w: D = None
        self.y: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.r: F = None
        self.u: B = None
        self.t: H = None
        self.z: G = None
        self.o: B = None
        self.w: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: B = None
        self.txt = txt

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

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

d.r = h
d.s = n
d.w = j
d.y = j
a.o = n
a.p = d
a.y = h
a.q = j
a.x = m
h.x = n
h.t = n
h.r = k
h.u = a
h.o = a
h.w = a
h.z = m
j.t = a
j.x = a
j.u = a
f.y = k
k.x = h
k.v = h
k.o = f
k.s = d
k.y = m
k.q = j
m.z = a
m.r = a
n.o = d
n.t = a
n.z = j
assert n.o.w.u.o.o.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: H = None
        self.w: D = None
        self.y: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.r: F = None
        self.u: B = None
        self.t: H = None
        self.z: G = None
        self.o: B = None
        self.w: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: B = None
        self.txt = txt

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

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

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