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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.u: F = None
        self.z: E = None
        self.r: F = None
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: D = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: D = None
        self.txt = txt

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

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

l = A("l")
b = B("b")
g = C("g")
d = D("d")
m = E("m")
j = F("j")
h = G("h")
n = A("n")
a = D("a")

l.p = j
l.v = j
l.s = n
l.w = g
l.u = b
b.z = d
g.t = j
g.u = j
g.r = j
g.z = m
g.s = n
d.u = n
d.q = a
d.z = m
m.t = j
m.v = a
j.t = n
h.p = j
n.p = j
n.v = j
n.s = l
n.w = g
n.u = b
a.u = l
a.q = d
a.z = m
assert a.u.s.p.t.p.t.s.txt == "
class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: A = None
        self.w: C = None
        self.u: B = None
        self.v: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.u: F = None
        self.z: E = None
        self.r: F = None
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: D = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: D = None
        self.txt = txt

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

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

l = A("l")
b = B("b")
g = C("g")
d = D("d")
m = E("m")
j = F("j")
h = G("h")
n = A("n")
a = D("a")

l.p = j
l.v = j
l.s = n
l.w = g
l.u = b
b.z = d
g.t = j
g.u = j
g.r = j
g.z = m
g.s = n
d.u = n
d.q = a
d.z = m
m.t = j
m.v = a
j.t = n
h.p = j
n.p = j
n.v = j
n.s = l
n.w = g
n.u = b
a.u = l
a.q = d
a.z = m
assert a.u.s.p.t.p.t.s.txt == "l"