class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: I = None
        self.w: F = None
        self.x: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: I = None
        self.v: E = None
        self.z: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: C = None
        self.o: A = None
        self.t: A = None
        self.w: D = None
        self.z: B = None
        self.q: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: E = None
        self.v: G = None
        self.t: F = None
        self.w: H = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: I = None
        self.v: E = None
        self.z: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: C = None
        self.o: A = None
        self.t: A = None
        self.w: D = None
        self.z: B = None
        self.q: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: E = None
        self.v: G = None
        self.t: F = None
        self.w: H = None
        self.txt = txt

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

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