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

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

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.q: G = None
        self.u: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.y: C = None
        self.p: G = None
        self.q: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: B = None
        self.y: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: H = None
        self.z: E = None
        self.w: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.p: A = None
        self.x: D = None
        self.t: A = None
        self.z: E = None
        self.r: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: C = None
        self.w: E = None
        self.p: B = None
        self.o: A = None
        self.u: B = None
        self.txt = txt

e = A("e")
b = B("b")
n = C("n")
d = D("d")
g = E("g")
c = F("c")
k = G("k")
m = H("m")
i = A("i")
j = B("j")

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

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

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.q: G = None
        self.u: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.y: C = None
        self.p: G = None
        self.q: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: B = None
        self.y: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: H = None
        self.z: E = None
        self.w: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.p: A = None
        self.x: D = None
        self.t: A = None
        self.z: E = None
        self.r: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: C = None
        self.w: E = None
        self.p: B = None
        self.o: A = None
        self.u: B = None
        self.txt = txt

e = A("e")
b = B("b")
n = C("n")
d = D("d")
g = E("g")
c = F("c")
k = G("k")
m = H("m")
i = A("i")
j = B("j")

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