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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: B = None
        self.q: D = None
        self.x: D = None
        self.z: F = None
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: B = None
        self.q: D = None
        self.x: D = None
        self.z: F = None
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: E = None
        self.txt = txt

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

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