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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.p: B = None
        self.v: G = None
        self.x: D = None
        self.y: G = None
        self.s: D = None
        self.z: B = None
        self.u: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: H = None
        self.u: H = None
        self.z: G = None
        self.r: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.p: B = None
        self.v: G = None
        self.x: D = None
        self.y: G = None
        self.s: D = None
        self.z: B = None
        self.u: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: H = None
        self.u: H = None
        self.z: G = None
        self.r: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

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

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

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

f.o = e
f.p = a
f.t = a
f.y = g
g.q = i
b.r = e
b.x = e
b.s = e
b.p = g
b.z = g
b.v = k
b.y = k
b.u = f
e.p = i
e.r = i
e.x = a
e.u = a
e.z = k
i.p = f
n.u = a
k.q = b
a.r = f
assert e.z.q.u.y.q.txt == "i"