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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.s: D = None
        self.y: A = None
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: A = None
        self.u: F = None
        self.v: D = None
        self.x: C = None
        self.y: C = None
        self.txt = txt

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

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

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

e = A("e")
l = B("l")
h = C("h")
a = D("a")
f = E("f")
c = F("c")
k = C("k")
b = D("b")
d = B("d")

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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.s: D = None
        self.y: A = None
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: A = None
        self.u: F = None
        self.v: D = None
        self.x: C = None
        self.y: C = None
        self.txt = txt

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

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

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

e = A("e")
l = B("l")
h = C("h")
a = D("a")
f = E("f")
c = F("c")
k = C("k")
b = D("b")
d = B("d")

e.y = h
e.p = c
e.q = f
e.u = f
l.p = a
l.s = a
l.y = e
l.t = f
h.p = f
h.r = e
h.u = c
h.v = b
h.x = k
h.y = k
a.o = d
a.q = e
a.y = e
a.s = f
a.r = k
f.x = c
f.o = e
c.y = f
c.t = f
c.r = e
k.p = f
k.r = e
k.u = c
k.v = b
k.x = h
k.y = h
b.o = l
b.q = e
b.y = e
b.s = f
b.r = h
d.p = a
d.s = b
d.y = e
d.t = f
assert d.y.q.o.p.txt == "c"