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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

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