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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: D = None
        self.s: G = None
        self.w: A = None
        self.x: E = None
        self.p: D = None
        self.txt = txt

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

g = A("g")
k = B("k")
e = C("e")
b = D("b")
d = E("d")
i = F("i")
l = G("l")
f = D("f")
h = B("h")
n = A("n")

g.p = f
k.r = b
k.y = d
k.q = d
k.w = h
k.x = h
k.s = n
e.r = k
b.s = l
d.v = n
d.r = k
i.q = h
i.y = b
i.p = b
i.s = l
i.w = g
i.x = d
l.q = b
l.r = f
f.s = l
h.r = f
h.y = d
h.q = d
h.w = k
h.x = k
h.s = n
n.p = f
assert k.s.p.s.q.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: D = None
        self.s: G = None
        self.w: A = None
        self.x: E = None
        self.p: D = None
        self.txt = txt

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

g = A("g")
k = B("k")
e = C("e")
b = D("b")
d = E("d")
i = F("i")
l = G("l")
f = D("f")
h = B("h")
n = A("n")

g.p = f
k.r = b
k.y = d
k.q = d
k.w = h
k.x = h
k.s = n
e.r = k
b.s = l
d.v = n
d.r = k
i.q = h
i.y = b
i.p = b
i.s = l
i.w = g
i.x = d
l.q = b
l.r = f
f.s = l
h.r = f
h.y = d
h.q = d
h.w = k
h.x = k
h.s = n
n.p = f
assert k.s.p.s.q.txt == "b"