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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: D = None
        self.u: I = None
        self.y: I = None
        self.p: G = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: I = None
        self.r: D = None
        self.t: F = None
        self.z: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: H = None
        self.x: C = None
        self.v: G = None
        self.u: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: B = None
        self.p: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: D = None
        self.p: B = None
        self.r: F = None
        self.y: I = None
        self.x: B = None
        self.txt = txt

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

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

e.u = c
e.w = m
g.q = d
g.t = f
g.u = m
g.y = m
g.p = j
g.v = b
n.q = f
n.r = f
n.x = m
n.t = b
n.z = e
f.q = g
f.o = c
f.x = n
f.v = j
f.u = b
d.t = g
d.s = b
d.x = j
b.o = f
b.u = g
b.p = j
j.u = g
j.r = d
c.z = b
c.r = b
c.u = f
c.p = g
c.x = g
c.y = m
m.z = d
assert m.z.s.p.r.x.r.x.txt == "
class A:
    def __init__(self, txt: str):
        self.u: H = None
        self.w: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: D = None
        self.u: I = None
        self.y: I = None
        self.p: G = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: I = None
        self.r: D = None
        self.t: F = None
        self.z: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: H = None
        self.x: C = None
        self.v: G = None
        self.u: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: B = None
        self.p: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: D = None
        self.p: B = None
        self.r: F = None
        self.y: I = None
        self.x: B = None
        self.txt = txt

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

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

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