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

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: F = None
        self.y: G = None
        self.s: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: H = None
        self.u: G = None
        self.t: F = None
        self.r: F = None
        self.w: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.y: G = None
        self.t: C = None
        self.z: E = None
        self.s: B = None
        self.x: A = None
        self.v: E = None
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: C = None
        self.v: E = None
        self.q: B = None
        self.x: H = None
        self.o: A = None
        self.z: F = None
        self.s: H = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: F = None
        self.y: G = None
        self.s: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: H = None
        self.u: G = None
        self.t: F = None
        self.r: F = None
        self.w: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.y: G = None
        self.t: C = None
        self.z: E = None
        self.s: B = None
        self.x: A = None
        self.v: E = None
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: C = None
        self.v: E = None
        self.q: B = None
        self.x: H = None
        self.o: A = None
        self.z: F = None
        self.s: H = None
        self.txt = txt

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

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

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