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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: A = None
        self.v: E = None
        self.z: E = None
        self.w: E = None
        self.q: D = None
        self.r: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: B = None
        self.p: E = None
        self.x: A = None
        self.v: A = None
        self.y: C = None
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.p: A = None
        self.z: E = None
        self.q: F = None
        self.txt = txt

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

f.o = k
c.y = a
c.x = f
c.v = k
c.z = k
c.w = k
c.q = n
c.r = m
d.r = a
d.q = c
d.z = c
d.v = c
d.t = f
l.o = c
l.x = d
k.q = b
k.z = a
a.o = l
a.s = c
a.p = k
a.x = f
a.v = f
a.y = d
a.w = i
i.o = a
m.t = f
m.p = f
m.z = k
m.q = a
b.t = f
b.p = f
b.z = k
b.q = a
n.o = c
n.x = d
assert d.t.o.z.y.r.w.o.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: A = None
        self.v: E = None
        self.z: E = None
        self.w: E = None
        self.q: D = None
        self.r: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: B = None
        self.p: E = None
        self.x: A = None
        self.v: A = None
        self.y: C = None
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.p: A = None
        self.z: E = None
        self.q: F = None
        self.txt = txt

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

f.o = k
c.y = a
c.x = f
c.v = k
c.z = k
c.w = k
c.q = n
c.r = m
d.r = a
d.q = c
d.z = c
d.v = c
d.t = f
l.o = c
l.x = d
k.q = b
k.z = a
a.o = l
a.s = c
a.p = k
a.x = f
a.v = f
a.y = d
a.w = i
i.o = a
m.t = f
m.p = f
m.z = k
m.q = a
b.t = f
b.p = f
b.z = k
b.q = a
n.o = c
n.x = d
assert d.t.o.z.y.r.w.o.y.t.txt == "f"