class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: G = None
        self.s: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: G = None
        self.y: C = None
        self.r: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: G = None
        self.y: C = None
        self.r: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

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