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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: A = None
        self.o: F = None
        self.w: C = None
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: E = None
        self.o: F = None
        self.v: B = None
        self.y: A = None
        self.z: D = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: A = None
        self.o: F = None
        self.w: C = None
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: E = None
        self.o: F = None
        self.v: B = None
        self.y: A = None
        self.z: D = None
        self.txt = txt

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

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