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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: F = None
        self.q: A = None
        self.t: B = None
        self.o: D = None
        self.p: F = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: F = None
        self.q: A = None
        self.t: B = None
        self.o: D = None
        self.p: F = None
        self.txt = txt

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

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