class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: G = None
        self.y: B = None
        self.x: F = None
        self.t: G = None
        self.z: H = None
        self.u: E = None
        self.w: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.u: C = None
        self.v: D = None
        self.z: C = None
        self.o: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: C = None
        self.w: B = None
        self.u: B = None
        self.x: H = None
        self.t: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: C = None
        self.x: D = None
        self.o: B = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.u: C = None
        self.v: D = None
        self.z: C = None
        self.o: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: C = None
        self.w: B = None
        self.u: B = None
        self.x: H = None
        self.t: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: C = None
        self.x: D = None
        self.o: B = None
        self.txt = txt

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

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

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