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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

j = A("j")
m = B("m")
h = C("h")
e = D("e")
b = E("b")
l = F("l")
g = G("g")
d = A("d")
a = G("a")

j.w = b
j.r = b
j.u = e
j.z = a
j.v = h
m.x = e
h.w = e
h.p = e
h.y = m
h.x = j
h.q = a
e.p = h
e.u = h
e.s = a
e.z = l
e.o = m
b.z = h
l.p = j
g.w = h
d.w = b
d.r = b
d.u = e
d.z = g
d.v = h
a.w = h
assert a.w.q.w.y.x.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: D = None
        self.z: G = None
        self.r: E = None
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

j = A("j")
m = B("m")
h = C("h")
e = D("e")
b = E("b")
l = F("l")
g = G("g")
d = A("d")
a = G("a")

j.w = b
j.r = b
j.u = e
j.z = a
j.v = h
m.x = e
h.w = e
h.p = e
h.y = m
h.x = j
h.q = a
e.p = h
e.u = h
e.s = a
e.z = l
e.o = m
b.z = h
l.p = j
g.w = h
d.w = b
d.r = b
d.u = e
d.z = g
d.v = h
a.w = h
assert a.w.q.w.y.x.txt == "e"