class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: C = None
        self.x: E = None
        self.q: G = None
        self.u: G = None
        self.p: C = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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