class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: F = None
        self.w: D = None
        self.q: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: E = None
        self.p: C = None
        self.u: E = None
        self.w: D = None
        self.s: C = None
        self.v: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: G = None
        self.r: B = None
        self.q: H = None
        self.p: A = None
        self.v: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: F = None
        self.q: F = None
        self.w: B = None
        self.x: B = None
        self.v: B = None
        self.t: G = None
        self.p: D = None
        self.txt = txt

j = A("j")
n = B("n")
b = C("b")
c = D("c")
g = E("g")
e = F("e")
h = G("h")
m = H("m")
f = C("f")

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: E = None
        self.p: C = None
        self.u: E = None
        self.w: D = None
        self.s: C = None
        self.v: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: G = None
        self.r: B = None
        self.q: H = None
        self.p: A = None
        self.v: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: F = None
        self.q: F = None
        self.w: B = None
        self.x: B = None
        self.v: B = None
        self.t: G = None
        self.p: D = None
        self.txt = txt

j = A("j")
n = B("n")
b = C("b")
c = D("c")
g = E("g")
e = F("e")
h = G("h")
m = H("m")
f = C("f")

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