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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: B = None
        self.t: D = None
        self.y: G = None
        self.u: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: A = None
        self.v: F = None
        self.w: E = None
        self.r: E = None
        self.s: C = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: B = None
        self.t: D = None
        self.y: G = None
        self.u: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: A = None
        self.v: F = None
        self.w: E = None
        self.r: E = None
        self.s: C = None
        self.txt = txt

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

j.u = h
g.q = k
g.w = d
g.t = d
g.r = d
g.v = a
d.x = j
d.p = h
h.s = j
h.u = j
h.x = n
k.z = n
k.y = n
k.x = g
k.t = h
k.u = h
a.r = h
n.o = a
n.v = a
n.t = j
n.w = k
n.r = k
n.s = d
assert h.u.u.s.u.s.u.s.txt == "j"