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

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: D = None
        self.z: G = None
        self.y: E = None
        self.t: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: F = None
        self.o: B = None
        self.p: C = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: D = None
        self.z: G = None
        self.y: E = None
        self.t: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: F = None
        self.o: B = None
        self.p: C = None
        self.txt = txt

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

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

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

g.u = f
g.v = a
n.z = a
h.o = e
h.q = f
h.z = a
h.y = c
h.t = n
f.w = n
f.p = n
f.x = h
c.y = f
c.q = e
c.o = n
c.p = h
e.v = c
a.s = f
a.z = n
a.y = b
b.u = f
b.v = a
assert b.u.w.z.z.z.s.p.txt == "n"