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

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

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

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

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

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

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

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

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

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

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

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

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

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

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