class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.q: D = None
        self.u: C = None
        self.t: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: B = None
        self.o: A = None
        self.w: D = None
        self.t: D = None
        self.v: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: B = None
        self.y: B = None
        self.p: D = None
        self.u: F = None
        self.q: B = None
        self.txt = txt

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

e.w = h
d.o = f
d.q = h
d.t = h
d.u = l
l.r = k
l.p = e
h.y = n
h.x = d
h.o = d
h.p = k
k.p = d
k.o = n
n.y = h
n.w = h
n.t = h
n.v = h
n.q = d
n.o = e
f.o = n
f.u = n
f.t = d
f.y = d
f.q = d
f.p = h
b.p = d
b.o = n
assert k.p.o.o.y.o.u.p.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.q: D = None
        self.u: C = None
        self.t: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: B = None
        self.o: A = None
        self.w: D = None
        self.t: D = None
        self.v: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: B = None
        self.y: B = None
        self.p: D = None
        self.u: F = None
        self.q: B = None
        self.txt = txt

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

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