class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: D = None
        self.z: B = None
        self.s: D = None
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.p: E = None
        self.q: A = None
        self.o: H = None
        self.x: C = None
        self.u: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: D = None
        self.z: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.x: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.p: E = None
        self.q: A = None
        self.o: H = None
        self.x: C = None
        self.u: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: D = None
        self.z: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.x: G = None
        self.txt = txt

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

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