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

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: F = None
        self.s: D = None
        self.t: F = None
        self.o: C = None
        self.txt = txt

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

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

k = A("k")
c = B("c")
g = C("g")
n = D("n")
i = E("i")
e = F("e")
h = D("h")
a = B("a")
d = B("d")
b = E("b")

k.o = e
c.q = e
c.v = e
c.r = e
c.y = d
g.y = i
n.y = i
n.q = e
n.t = e
n.s = h
n.o = g
i.t = g
i.y = c
i.v = k
i.q = b
i.s = e
e.r = n
h.y = b
h.q = e
h.t = e
h.s = n
h.o = g
a.q = e
a.v = e
a.r = e
a.y = c
d.q = e
d.v = e
d.r = e
d.y = a
b.t = g
b.y = c
b.v = k
b.q = i
b.s = e
assert a.y.y.y.q.r.txt == "
class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: F = None
        self.s: D = None
        self.t: F = None
        self.o: C = None
        self.txt = txt

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

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

k = A("k")
c = B("c")
g = C("g")
n = D("n")
i = E("i")
e = F("e")
h = D("h")
a = B("a")
d = B("d")
b = E("b")

k.o = e
c.q = e
c.v = e
c.r = e
c.y = d
g.y = i
n.y = i
n.q = e
n.t = e
n.s = h
n.o = g
i.t = g
i.y = c
i.v = k
i.q = b
i.s = e
e.r = n
h.y = b
h.q = e
h.t = e
h.s = n
h.o = g
a.q = e
a.v = e
a.r = e
a.y = c
d.q = e
d.v = e
d.r = e
d.y = a
b.t = g
b.y = c
b.v = k
b.q = i
b.s = e
assert a.y.y.y.q.r.txt == "n"