class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: C = None
        self.w: D = None
        self.y: D = None
        self.p: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: E = None
        self.z: C = None
        self.p: B = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: E = None
        self.z: C = None
        self.p: B = None
        self.txt = txt

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

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