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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: B = None
        self.v: B = None
        self.y: C = None
        self.z: D = None
        self.p: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: A = None
        self.o: A = None
        self.p: F = None
        self.q: A = 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.v: D = None
        self.y: B = None
        self.u: A = None
        self.txt = txt

i = A("i")
f = B("f")
g = C("g")
m = D("m")
n = E("n")
k = F("k")
j = B("j")
d = B("d")
b = D("b")
a = C("a")

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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: B = None
        self.v: B = None
        self.y: C = None
        self.z: D = None
        self.p: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: A = None
        self.o: A = None
        self.p: F = None
        self.q: A = 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.v: D = None
        self.y: B = None
        self.u: A = None
        self.txt = txt

i = A("i")
f = B("f")
g = C("g")
m = D("m")
n = E("n")
k = F("k")
j = B("j")
d = B("d")
b = D("b")
a = C("a")

i.w = n
i.r = n
f.o = m
f.r = j
f.v = d
f.y = a
f.z = b
f.p = k
g.o = a
g.q = j
m.v = k
m.p = k
m.u = i
m.o = i
m.q = i
n.r = k
k.v = m
k.y = f
k.u = i
j.o = m
j.r = d
j.v = d
j.y = g
j.z = b
j.p = k
d.o = m
d.r = f
d.v = j
d.y = g
d.z = b
d.p = k
b.v = k
b.p = k
b.u = i
b.o = i
b.q = i
a.o = g
a.q = f
assert d.y.o.q.z.q.r.r.txt == "k"