class A:
    def __init__(self, txt: str):
        self.r: I = None
        self.z: D = None
        self.p: H = None
        self.w: F = None
        self.o: C = None
        self.q: C = None
        self.u: D = None
        self.t: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: I = None
        self.w: F = None
        self.q: E = None
        self.p: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.p: F = None
        self.z: I = None
        self.y: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: I = None
        self.u: F = None
        self.r: D = None
        self.q: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: I = None
        self.y: H = None
        self.x: B = None
        self.u: C = None
        self.o: A = None
        self.r: E = None
        self.v: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.o: B = None
        self.t: I = None
        self.u: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: I = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: I = None
        self.w: F = None
        self.q: E = None
        self.p: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.p: F = None
        self.z: I = None
        self.y: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: I = None
        self.u: F = None
        self.r: D = None
        self.q: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: I = None
        self.y: H = None
        self.x: B = None
        self.u: C = None
        self.o: A = None
        self.r: E = None
        self.v: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.o: B = None
        self.t: I = None
        self.u: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: I = None
        self.txt = txt

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

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

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