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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: A = None
        self.o: C = None
        self.p: C = None
        self.txt = txt

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

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

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

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

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

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

i = A("i")
l = B("l")
b = C("b")
m = D("m")
j = E("j")
h = F("h")
g = G("g")
k = H("k")

i.u = g
i.s = h
l.t = i
l.s = i
l.o = b
l.p = b
b.s = g
m.y = j
m.z = j
m.q = i
m.p = i
m.s = h
m.o = k
j.w = h
j.p = b
h.o = l
g.q = j
k.t = g
k.x = j
k.u = j
k.s = i
k.v = i
k.q = h
k.z = m
assert l.o.s.q.w.o.o.s.q.txt == "
class A:
    def __init__(self, txt: str):
        self.u: G = None
        self.s: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: A = None
        self.o: C = None
        self.p: C = None
        self.txt = txt

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

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

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

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

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

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

i = A("i")
l = B("l")
b = C("b")
m = D("m")
j = E("j")
h = F("h")
g = G("g")
k = H("k")

i.u = g
i.s = h
l.t = i
l.s = i
l.o = b
l.p = b
b.s = g
m.y = j
m.z = j
m.q = i
m.p = i
m.s = h
m.o = k
j.w = h
j.p = b
h.o = l
g.q = j
k.t = g
k.x = j
k.u = j
k.s = i
k.v = i
k.q = h
k.z = m
assert l.o.s.q.w.o.o.s.q.txt == "j"