class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.z: D = None
        self.p: E = None
        self.x: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: B = None
        self.s: B = None
        self.t: D = None
        self.txt = txt

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

d = A("d")
g = B("g")
l = C("l")
f = D("f")
e = E("e")
a = F("a")
h = B("h")
c = A("c")
k = B("k")

d.v = k
d.z = f
d.x = f
d.p = e
g.s = a
g.t = h
l.v = f
l.y = a
l.q = a
l.p = h
f.s = d
f.p = d
f.r = d
f.q = c
f.x = l
f.y = a
e.y = d
e.x = g
e.s = k
e.t = f
a.q = f
a.w = k
h.s = a
h.t = g
c.v = k
c.z = f
c.x = f
c.p = e
k.s = a
k.t = h
assert g.s.q.y.w.t.t.t.t.s.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.z: D = None
        self.p: E = None
        self.x: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: B = None
        self.s: B = None
        self.t: D = None
        self.txt = txt

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

d = A("d")
g = B("g")
l = C("l")
f = D("f")
e = E("e")
a = F("a")
h = B("h")
c = A("c")
k = B("k")

d.v = k
d.z = f
d.x = f
d.p = e
g.s = a
g.t = h
l.v = f
l.y = a
l.q = a
l.p = h
f.s = d
f.p = d
f.r = d
f.q = c
f.x = l
f.y = a
e.y = d
e.x = g
e.s = k
e.t = f
a.q = f
a.w = k
h.s = a
h.t = g
c.v = k
c.z = f
c.x = f
c.p = e
k.s = a
k.t = h
assert g.s.q.y.w.t.t.t.t.s.txt == "a"