class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.y: I = None
        self.p: E = None
        self.x: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: I = None
        self.s: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: I = None
        self.x: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.r: D = None
        self.v: H = None
        self.w: D = None
        self.u: H = None
        self.o: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: A = None
        self.y: B = None
        self.z: I = None
        self.v: C = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: I = None
        self.s: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: I = None
        self.x: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.r: D = None
        self.v: H = None
        self.w: D = None
        self.u: H = None
        self.o: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: A = None
        self.y: B = None
        self.z: I = None
        self.v: C = None
        self.txt = txt

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

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

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

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