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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: E = None
        self.y: A = None
        self.p: C = None
        self.r: I = None
        self.z: F = None
        self.o: G = None
        self.w: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: I = None
        self.y: H = None
        self.p: A = None
        self.w: G = None
        self.t: G = None
        self.s: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: H = None
        self.t: G = None
        self.s: C = None
        self.p: J = None
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: A = None
        self.w: E = None
        self.q: B = None
        self.x: D = None
        self.y: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: H = None
        self.w: H = None
        self.o: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: I = None
        self.x: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: J = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: E = None
        self.y: A = None
        self.p: C = None
        self.r: I = None
        self.z: F = None
        self.o: G = None
        self.w: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: I = None
        self.y: H = None
        self.p: A = None
        self.w: G = None
        self.t: G = None
        self.s: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: H = None
        self.t: G = None
        self.s: C = None
        self.p: J = None
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: A = None
        self.w: E = None
        self.q: B = None
        self.x: D = None
        self.y: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: H = None
        self.w: H = None
        self.o: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: I = None
        self.x: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: J = None
        self.txt = txt

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

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

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