class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: E = None
        self.u: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: F = None
        self.s: E = None
        self.q: F = None
        self.t: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: I = None
        self.s: C = None
        self.r: C = None
        self.y: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.r: J = None
        self.o: H = None
        self.v: F = None
        self.z: F = None
        self.t: F = None
        self.u: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.q: J = None
        self.y: J = None
        self.o: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: A = None
        self.z: I = None
        self.t: H = None
        self.o: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: F = None
        self.s: E = None
        self.q: F = None
        self.t: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: I = None
        self.s: C = None
        self.r: C = None
        self.y: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.r: J = None
        self.o: H = None
        self.v: F = None
        self.z: F = None
        self.t: F = None
        self.u: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.q: J = None
        self.y: J = None
        self.o: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: A = None
        self.z: I = None
        self.t: H = None
        self.o: B = None
        self.txt = txt

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

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