class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: E = None
        self.y: A = None
        self.x: B = None
        self.p: E = None
        self.z: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: H = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: E = None
        self.t: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: I = None
        self.v: C = None
        self.r: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: A = None
        self.w: D = None
        self.q: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: E = None
        self.u: H = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: E = None
        self.y: A = None
        self.x: B = None
        self.p: E = None
        self.z: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: H = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: E = None
        self.t: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: I = None
        self.v: C = None
        self.r: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: A = None
        self.w: D = None
        self.q: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: E = None
        self.u: H = None
        self.txt = txt

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

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

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