class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: B = None
        self.q: F = None
        self.s: G = None
        self.r: F = None
        self.w: F = None
        self.o: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.r: C = None
        self.txt = txt

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

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

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

m = A("m")
k = B("k")
g = C("g")
h = D("h")
l = E("l")
i = F("i")
e = G("e")
a = D("a")

m.p = l
m.t = k
m.q = i
m.r = i
m.w = i
m.s = e
m.o = e
k.w = m
g.s = h
g.x = m
h.y = m
h.r = g
l.z = h
l.u = h
i.o = e
i.u = e
i.r = e
i.t = e
i.v = m
i.s = a
i.x = g
e.v = i
e.q = k
e.u = h
a.y = m
a.r = g
assert h.r.x.o.v.s.r.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: B = None
        self.q: F = None
        self.s: G = None
        self.r: F = None
        self.w: F = None
        self.o: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.r: C = None
        self.txt = txt

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

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

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

m = A("m")
k = B("k")
g = C("g")
h = D("h")
l = E("l")
i = F("i")
e = G("e")
a = D("a")

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