class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: E = None
        self.t: F = None
        self.s: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: E = None
        self.z: A = None
        self.w: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.v: F = None
        self.q: E = None
        self.z: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: D = None
        self.q: A = None
        self.y: D = None
        self.txt = txt

g = A("g")
m = B("m")
c = C("c")
a = D("a")
h = E("h")
n = F("n")
e = D("e")

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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: E = None
        self.z: A = None
        self.w: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.v: F = None
        self.q: E = None
        self.z: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: D = None
        self.q: A = None
        self.y: D = None
        self.txt = txt

g = A("g")
m = B("m")
c = C("c")
a = D("a")
h = E("h")
n = F("n")
e = D("e")

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