class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: F = None
        self.z: C = None
        self.t: D = None
        self.v: C = None
        self.w: C = None
        self.x: B = None
        self.o: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: I = None
        self.t: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: H = None
        self.o: F = None
        self.v: I = None
        self.s: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: I = None
        self.q: H = None
        self.p: I = None
        self.t: H = None
        self.x: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: G = None
        self.t: A = None
        self.p: H = None
        self.z: G = None
        self.r: C = None
        self.x: E = None
        self.w: D = None
        self.y: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: I = None
        self.t: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: H = None
        self.o: F = None
        self.v: I = None
        self.s: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: I = None
        self.q: H = None
        self.p: I = None
        self.t: H = None
        self.x: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: G = None
        self.t: A = None
        self.p: H = None
        self.z: G = None
        self.r: C = None
        self.x: E = None
        self.w: D = None
        self.y: B = None
        self.txt = txt

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

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