class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: E = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: E = None
        self.u: B = None
        self.o: G = None
        self.x: G = None
        self.r: E = None
        self.w: D = None
        self.t: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: G = None
        self.q: G = None
        self.t: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: H = None
        self.u: A = None
        self.x: B = None
        self.y: E = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: E = None
        self.u: B = None
        self.o: G = None
        self.x: G = None
        self.r: E = None
        self.w: D = None
        self.t: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: G = None
        self.q: G = None
        self.t: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: H = None
        self.u: A = None
        self.x: B = None
        self.y: E = None
        self.txt = txt

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

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

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

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

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

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