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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: B = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.t: D = None
        self.o: H = None
        self.y: E = None
        self.z: E = None
        self.u: H = None
        self.q: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: B = None
        self.y: F = None
        self.o: F = None
        self.s: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: B = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.t: D = None
        self.o: H = None
        self.y: E = None
        self.z: E = None
        self.u: H = None
        self.q: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: B = None
        self.y: F = None
        self.o: F = None
        self.s: A = None
        self.txt = txt

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

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