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

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

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: G = None
        self.w: F = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: G = None
        self.w: F = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

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