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

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

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: F = None
        self.s: G = None
        self.y: H = None
        self.x: F = None
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.p: D = None
        self.s: F = None
        self.v: B = None
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: I = None
        self.w: G = None
        self.x: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: H = None
        self.u: C = None
        self.y: D = None
        self.z: G = None
        self.s: H = None
        self.x: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: G = None
        self.z: D = None
        self.txt = txt

l = A("l")
e = B("e")
b = C("b")
a = D("a")
m = E("m")
k = F("k")
c = G("c")
n = H("n")
h = I("h")
g = H("g")

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

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

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: F = None
        self.s: G = None
        self.y: H = None
        self.x: F = None
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.p: D = None
        self.s: F = None
        self.v: B = None
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: I = None
        self.w: G = None
        self.x: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: H = None
        self.u: C = None
        self.y: D = None
        self.z: G = None
        self.s: H = None
        self.x: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: G = None
        self.z: D = None
        self.txt = txt

l = A("l")
e = B("e")
b = C("b")
a = D("a")
m = E("m")
k = F("k")
c = G("c")
n = H("n")
h = I("h")
g = H("g")

l.r = g
l.u = h
l.q = h
l.y = n
e.z = a
e.p = c
b.w = c
b.s = c
b.r = k
b.x = k
b.y = n
b.z = m
a.v = l
m.r = k
m.s = k
m.q = k
m.p = a
m.v = e
k.r = a
k.o = h
k.w = c
k.x = l
c.p = b
n.r = g
n.s = g
n.u = b
n.y = a
n.z = c
n.x = k
h.u = a
h.z = a
h.s = c
g.r = n
g.s = n
g.u = b
g.y = a
g.z = c
g.x = k
assert n.r.u.x.x.y.u.z.txt == "m"