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

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.s: G = None
        self.q: D = None
        self.z: C = None
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: A = None
        self.p: B = None
        self.o: G = None
        self.r: G = None
        self.q: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.s: G = None
        self.q: D = None
        self.z: C = None
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: A = None
        self.p: B = None
        self.o: G = None
        self.r: G = None
        self.q: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

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

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