class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: F = None
        self.y: I = None
        self.w: D = None
        self.o: H = None
        self.q: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: H = None
        self.y: H = None
        self.t: D = None
        self.x: C = None
        self.w: 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.u: G = None
        self.w: B = None
        self.o: A = None
        self.q: E = None
        self.s: F = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: B = None
        self.t: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: H = None
        self.y: C = None
        self.w: I = None
        self.q: C = None
        self.r: I = None
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.u: F = None
        self.q: H = None
        self.o: E = None
        self.s: J = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: H = None
        self.y: H = None
        self.t: D = None
        self.x: C = None
        self.w: 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.u: G = None
        self.w: B = None
        self.o: A = None
        self.q: E = None
        self.s: F = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: B = None
        self.t: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: H = None
        self.y: C = None
        self.w: I = None
        self.q: C = None
        self.r: I = None
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.u: F = None
        self.q: H = None
        self.o: E = None
        self.s: J = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

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