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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

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

h = A("h")
m = B("m")
c = C("c")
a = D("a")
n = E("n")
i = F("i")
d = G("d")
j = B("j")
b = A("b")
k = C("k")

h.p = i
h.s = n
m.v = k
m.q = i
c.t = i
c.x = i
a.s = k
n.p = b
n.v = k
n.y = k
n.u = i
n.s = d
i.q = d
d.v = a
d.o = a
j.v = k
j.q = i
b.p = i
b.s = n
k.t = i
k.x = i
assert a.s.x.q.v.txt == "
class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

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

h = A("h")
m = B("m")
c = C("c")
a = D("a")
n = E("n")
i = F("i")
d = G("d")
j = B("j")
b = A("b")
k = C("k")

h.p = i
h.s = n
m.v = k
m.q = i
c.t = i
c.x = i
a.s = k
n.p = b
n.v = k
n.y = k
n.u = i
n.s = d
i.q = d
d.v = a
d.o = a
j.v = k
j.q = i
b.p = i
b.s = n
k.t = i
k.x = i
assert a.s.x.q.v.txt == "a"