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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: F = None
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: A = None
        self.r: A = None
        self.u: C = None
        self.q: B = None
        self.y: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.o: F = None
        self.u: B = None
        self.x: C = None
        self.txt = txt

f = A("f")
a = B("a")
i = C("i")
d = D("d")
g = E("g")
c = F("c")
n = G("n")
e = C("e")
h = A("h")

f.p = g
f.v = n
a.r = i
a.u = n
a.s = n
a.w = d
a.t = g
a.y = g
i.w = c
i.p = c
i.t = n
d.t = g
d.w = f
d.r = f
d.u = i
d.q = a
d.y = h
g.v = c
g.p = c
g.q = a
c.w = n
c.y = h
n.s = a
n.u = a
n.o = c
n.x = e
e.w = c
e.p = c
e.t = n
h.p = g
h.v = n
assert d.w.p.q.w.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: F = None
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: A = None
        self.r: A = None
        self.u: C = None
        self.q: B = None
        self.y: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.o: F = None
        self.u: B = None
        self.x: C = None
        self.txt = txt

f = A("f")
a = B("a")
i = C("i")
d = D("d")
g = E("g")
c = F("c")
n = G("n")
e = C("e")
h = A("h")

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