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

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

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

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: H = None
        self.o: I = None
        self.x: G = None
        self.q: H = None
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.q: H = None
        self.r: I = None
        self.s: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.y: C = None
        self.txt = txt

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

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

j = A("j")
h = B("h")
d = C("d")
f = D("f")
m = E("m")
g = F("g")
i = G("i")
c = H("c")
n = I("n")

j.r = h
j.z = m
j.t = c
j.p = c
j.u = i
j.q = i
h.z = c
h.w = j
h.q = j
h.r = f
h.x = f
h.o = m
h.s = m
d.z = c
f.r = i
f.x = i
f.s = c
f.q = c
f.o = n
f.p = j
m.w = i
m.q = c
m.r = n
m.s = f
g.s = m
g.z = i
i.o = c
i.y = d
c.r = f
c.t = h
n.o = m
n.w = i
assert m.r.w.y.z.r.p.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.z: E = None
        self.t: H = None
        self.p: H = None
        self.u: G = None
        self.q: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: H = None
        self.o: I = None
        self.x: G = None
        self.q: H = None
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.q: H = None
        self.r: I = None
        self.s: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.y: C = None
        self.txt = txt

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

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

j = A("j")
h = B("h")
d = C("d")
f = D("f")
m = E("m")
g = F("g")
i = G("i")
c = H("c")
n = I("n")

j.r = h
j.z = m
j.t = c
j.p = c
j.u = i
j.q = i
h.z = c
h.w = j
h.q = j
h.r = f
h.x = f
h.o = m
h.s = m
d.z = c
f.r = i
f.x = i
f.s = c
f.q = c
f.o = n
f.p = j
m.w = i
m.q = c
m.r = n
m.s = f
g.s = m
g.z = i
i.o = c
i.y = d
c.r = f
c.t = h
n.o = m
n.w = i
assert m.r.w.y.z.r.p.r.txt == "h"