class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: E = None
        self.r: G = None
        self.u: F = None
        self.v: D = None
        self.q: E = None
        self.o: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.z: D = None
        self.x: D = None
        self.r: D = None
        self.t: E = None
        self.y: E = None
        self.u: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: E = None
        self.s: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.s: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: D = None
        self.z: A = None
        self.txt = txt

j = A("j")
n = B("n")
b = C("b")
e = D("e")
f = E("f")
d = F("d")
k = G("k")
i = C("i")

j.p = i
j.s = f
j.q = f
j.r = k
j.u = d
j.o = d
j.v = e
n.x = j
b.v = n
b.z = e
b.x = e
b.r = e
b.u = e
b.t = f
b.y = f
e.x = n
e.p = f
e.s = k
f.v = n
f.u = d
f.w = k
f.p = j
d.q = k
d.s = e
k.u = n
k.v = e
k.z = j
i.v = n
i.z = e
i.x = e
i.r = e
i.u = e
i.t = f
i.y = f
assert d.s.x.x.s.w.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: E = None
        self.r: G = None
        self.u: F = None
        self.v: D = None
        self.q: E = None
        self.o: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.z: D = None
        self.x: D = None
        self.r: D = None
        self.t: E = None
        self.y: E = None
        self.u: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: E = None
        self.s: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.s: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: D = None
        self.z: A = None
        self.txt = txt

j = A("j")
n = B("n")
b = C("b")
e = D("e")
f = E("f")
d = F("d")
k = G("k")
i = C("i")

j.p = i
j.s = f
j.q = f
j.r = k
j.u = d
j.o = d
j.v = e
n.x = j
b.v = n
b.z = e
b.x = e
b.r = e
b.u = e
b.t = f
b.y = f
e.x = n
e.p = f
e.s = k
f.v = n
f.u = d
f.w = k
f.p = j
d.q = k
d.s = e
k.u = n
k.v = e
k.z = j
i.v = n
i.z = e
i.x = e
i.r = e
i.u = e
i.t = f
i.y = f
assert d.s.x.x.s.w.txt == "k"