class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: D = None
        self.y: A = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.u: G = None
        self.r: E = None
        self.p: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: B = None
        self.x: A = None
        self.v: E = None
        self.txt = txt

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

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

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

a.u = m
a.v = k
a.y = h
n.s = f
m.p = n
k.t = f
k.u = f
k.p = f
k.r = d
g.s = m
g.z = n
g.x = h
g.v = d
b.s = d
b.p = f
b.v = f
b.q = h
b.x = n
f.q = b
f.t = c
f.s = h
f.w = m
f.x = g
c.t = f
c.u = f
c.p = f
c.r = d
d.s = m
d.z = n
d.x = h
d.v = g
h.u = m
h.v = k
h.y = a
assert a.u.p.s.t.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: D = None
        self.y: A = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.u: G = None
        self.r: E = None
        self.p: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: B = None
        self.x: A = None
        self.v: E = None
        self.txt = txt

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

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

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

a.u = m
a.v = k
a.y = h
n.s = f
m.p = n
k.t = f
k.u = f
k.p = f
k.r = d
g.s = m
g.z = n
g.x = h
g.v = d
b.s = d
b.p = f
b.v = f
b.q = h
b.x = n
f.q = b
f.t = c
f.s = h
f.w = m
f.x = g
c.t = f
c.u = f
c.p = f
c.r = d
d.s = m
d.z = n
d.x = h
d.v = g
h.u = m
h.v = k
h.y = a
assert a.u.p.s.t.txt == "c"