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

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: A = None
        self.p: F = None
        self.y: F = None
        self.txt = txt

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

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

j = A("j")
i = B("i")
k = C("k")
n = D("n")
g = E("g")
d = F("d")
m = G("m")
h = E("h")

j.w = i
j.z = i
j.y = i
j.s = h
j.p = h
j.v = m
i.o = h
i.x = j
i.u = j
k.p = m
n.x = j
n.o = k
g.w = h
g.t = j
g.p = d
g.y = d
d.u = k
d.x = k
d.z = k
d.r = j
d.v = m
d.s = h
d.p = h
m.t = k
m.w = j
h.w = g
h.t = j
h.p = d
h.y = d
assert i.x.v.w.v.w.y.x.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: E = None
        self.z: B = None
        self.p: E = None
        self.v: G = None
        self.y: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: A = None
        self.p: F = None
        self.y: F = None
        self.txt = txt

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

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

j = A("j")
i = B("i")
k = C("k")
n = D("n")
g = E("g")
d = F("d")
m = G("m")
h = E("h")

j.w = i
j.z = i
j.y = i
j.s = h
j.p = h
j.v = m
i.o = h
i.x = j
i.u = j
k.p = m
n.x = j
n.o = k
g.w = h
g.t = j
g.p = d
g.y = d
d.u = k
d.x = k
d.z = k
d.r = j
d.v = m
d.s = h
d.p = h
m.t = k
m.w = j
h.w = g
h.t = j
h.p = d
h.y = d
assert i.x.v.w.v.w.y.x.txt == "j"