class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: C = None
        self.w: G = None
        self.r: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: E = None
        self.o: D = None
        self.x: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: B = None
        self.q: G = None
        self.t: F = None
        self.v: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.z: C = None
        self.o: B = None
        self.r: A = None
        self.q: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: E = None
        self.o: D = None
        self.x: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: B = None
        self.q: G = None
        self.t: F = None
        self.v: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.z: C = None
        self.o: B = None
        self.r: A = None
        self.q: F = None
        self.txt = txt

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

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