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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: F = None
        self.p: F = None
        self.t: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: E = None
        self.u: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

i.q = k
i.o = h
n.o = k
n.x = h
n.p = f
n.t = a
c.q = n
c.v = m
c.t = a
c.u = h
c.p = e
m.q = n
m.y = k
m.u = h
k.y = c
f.x = n
l.q = n
l.y = k
l.u = h
h.x = n
a.q = k
a.o = f
e.q = k
e.o = h
assert a.q.y.p.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: F = None
        self.p: F = None
        self.t: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: E = None
        self.u: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

i.q = k
i.o = h
n.o = k
n.x = h
n.p = f
n.t = a
c.q = n
c.v = m
c.t = a
c.u = h
c.p = e
m.q = n
m.y = k
m.u = h
k.y = c
f.x = n
l.q = n
l.y = k
l.u = h
h.x = n
a.q = k
a.o = f
e.q = k
e.o = h
assert a.q.y.p.txt == "e"