class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.v: B = None
        self.y: E = None
        self.p: E = None
        self.s: B = None
        self.x: B = None
        self.u: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: A = None
        self.t: E = None
        self.w: F = None
        self.o: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: F = None
        self.u: I = None
        self.r: A = None
        self.p: F = None
        self.y: D = None
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: D = None
        self.s: J = None
        self.y: B = None
        self.x: C = None
        self.z: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: J = None
        self.s: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.u: D = None
        self.p: A = None
        self.t: J = None
        self.w: G = None
        self.x: I = None
        self.r: C = None
        self.q: D = None
        self.z: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: C = None
        self.v: J = None
        self.x: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: C = None
        self.p: C = None
        self.z: C = None
        self.u: H = None
        self.w: D = None
        self.x: I = None
        self.o: A = None
        self.t: A = None
        self.s: I = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: A = None
        self.t: E = None
        self.w: F = None
        self.o: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: F = None
        self.u: I = None
        self.r: A = None
        self.p: F = None
        self.y: D = None
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: D = None
        self.s: J = None
        self.y: B = None
        self.x: C = None
        self.z: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: J = None
        self.s: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.u: D = None
        self.p: A = None
        self.t: J = None
        self.w: G = None
        self.x: I = None
        self.r: C = None
        self.q: D = None
        self.z: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: C = None
        self.v: J = None
        self.x: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: C = None
        self.p: C = None
        self.z: C = None
        self.u: H = None
        self.w: D = None
        self.x: I = None
        self.o: A = None
        self.t: A = None
        self.s: I = None
        self.txt = txt

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

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