class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.o: D = None
        self.y: C = None
        self.q: D = None
        self.x: G = None
        self.v: H = None
        self.r: D = None
        self.w: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.q: H = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: D = None
        self.s: A = None
        self.y: H = None
        self.q: F = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: D = None
        self.v: H = None
        self.q: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.y: E = None
        self.w: F = None
        self.u: D = None
        self.txt = txt

n = A("n")
h = B("h")
c = C("c")
f = D("f")
a = E("a")
d = F("d")
g = G("g")
l = H("l")
e = D("e")

n.u = f
n.q = f
n.o = e
n.r = e
n.y = c
n.x = g
n.v = l
n.w = d
h.v = g
h.q = l
h.y = c
c.r = f
c.o = n
f.p = e
f.s = n
f.y = l
f.q = d
f.o = d
a.t = c
a.o = e
a.q = e
a.v = l
d.o = n
d.t = n
d.q = n
d.r = f
g.v = c
g.u = c
g.t = h
g.p = f
g.s = f
l.s = g
l.y = a
l.w = d
l.u = e
e.p = f
e.s = n
e.y = l
e.q = d
e.o = d
assert d.r.p.q.o.u.q.r.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.o: D = None
        self.y: C = None
        self.q: D = None
        self.x: G = None
        self.v: H = None
        self.r: D = None
        self.w: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.q: H = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: D = None
        self.s: A = None
        self.y: H = None
        self.q: F = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: D = None
        self.v: H = None
        self.q: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.y: E = None
        self.w: F = None
        self.u: D = None
        self.txt = txt

n = A("n")
h = B("h")
c = C("c")
f = D("f")
a = E("a")
d = F("d")
g = G("g")
l = H("l")
e = D("e")

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