class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: F = None
        self.q: E = None
        self.x: C = None
        self.u: D = None
        self.t: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: A = None
        self.r: A = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: F = None
        self.q: E = None
        self.x: C = None
        self.u: D = None
        self.t: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: A = None
        self.r: A = None
        self.txt = txt

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

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

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