class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: B = None
        self.r: C = None
        self.o: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: B = None
        self.y: F = None
        self.t: C = None
        self.q: F = None
        self.p: E = None
        self.z: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: D = None
        self.r: C = None
        self.s: B = None
        self.p: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: H = None
        self.z: A = None
        self.o: F = None
        self.s: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: B = None
        self.y: F = None
        self.t: C = None
        self.q: F = None
        self.p: E = None
        self.z: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: D = None
        self.r: C = None
        self.s: B = None
        self.p: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: H = None
        self.z: A = None
        self.o: F = None
        self.s: C = None
        self.txt = txt

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

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

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