class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: B = None
        self.r: D = None
        self.p: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: F = None
        self.txt = txt

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

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

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

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

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

f.u = a
f.p = a
f.s = d
f.r = j
m.t = n
m.p = f
h.o = f
h.u = c
j.t = f
a.y = m
a.x = f
a.r = n
c.p = g
c.r = h
c.z = h
c.u = h
c.t = j
c.s = f
c.x = a
g.v = a
n.v = a
d.t = g
d.p = f
assert h.u.s.s.p.s.p.r.t.p.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: B = None
        self.r: D = None
        self.p: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: F = None
        self.txt = txt

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

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

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

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

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

f.u = a
f.p = a
f.s = d
f.r = j
m.t = n
m.p = f
h.o = f
h.u = c
j.t = f
a.y = m
a.x = f
a.r = n
c.p = g
c.r = h
c.z = h
c.u = h
c.t = j
c.s = f
c.x = a
g.v = a
n.v = a
d.t = g
d.p = f
assert h.u.s.s.p.s.p.r.t.p.txt == "a"