class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.x: E = None
        self.q: C = None
        self.v: G = None
        self.w: E = None
        self.t: C = None
        self.z: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: E = None
        self.txt = txt

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

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

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

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

h = A("h")
n = B("n")
c = C("c")
e = D("e")
a = E("a")
l = F("l")
j = G("j")
g = G("g")
f = B("f")

h.r = j
h.v = j
h.z = j
h.x = a
h.w = a
h.q = c
h.t = c
n.r = c
n.t = j
n.x = a
n.v = e
n.q = l
c.o = e
c.w = a
e.z = h
e.v = h
e.q = h
e.u = f
e.p = c
e.t = a
e.s = a
a.r = l
a.p = e
a.s = g
l.r = a
j.p = h
j.w = l
j.o = n
j.u = c
g.p = h
g.w = l
g.o = f
g.u = c
f.r = c
f.t = g
f.x = a
f.v = e
f.q = l
assert g.p.w.r.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.x: E = None
        self.q: C = None
        self.v: G = None
        self.w: E = None
        self.t: C = None
        self.z: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: E = None
        self.txt = txt

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

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

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

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

h = A("h")
n = B("n")
c = C("c")
e = D("e")
a = E("a")
l = F("l")
j = G("j")
g = G("g")
f = B("f")

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