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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: B = None
        self.q: E = None
        self.z: D = None
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: C = None
        self.t: G = None
        self.u: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: A = None
        self.u: C = None
        self.t: E = None
        self.txt = txt

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

b = A("b")
m = B("m")
a = C("a")
c = D("c")
h = E("h")
e = F("e")
j = G("j")
k = E("k")

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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: B = None
        self.q: E = None
        self.z: D = None
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: C = None
        self.t: G = None
        self.u: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: A = None
        self.u: C = None
        self.t: E = None
        self.txt = txt

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

b = A("b")
m = B("m")
a = C("a")
c = D("c")
h = E("h")
e = F("e")
j = G("j")
k = E("k")

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