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

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.u: A = None
        self.t: F = None
        self.p: E = None
        self.v: A = None
        self.z: D = None
        self.o: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.w: E = None
        self.z: A = None
        self.r: F = None
        self.y: G = None
        self.p: G = None
        self.q: G = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.u: A = None
        self.t: F = None
        self.p: E = None
        self.v: A = None
        self.z: D = None
        self.o: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.w: E = None
        self.z: A = None
        self.r: F = None
        self.y: G = None
        self.p: G = None
        self.q: G = None
        self.txt = txt

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

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

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

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

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