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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.v: D = None
        self.x: F = None
        self.t: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: F = None
        self.r: F = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.v: D = None
        self.x: F = None
        self.t: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: F = None
        self.r: F = None
        self.txt = txt

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

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

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

d.p = a
j.v = g
j.u = b
h.o = d
h.v = a
h.x = e
h.t = l
a.u = e
g.x = j
g.z = e
g.r = e
c.x = b
c.y = a
c.s = e
c.w = h
l.t = h
l.s = e
l.r = b
l.x = a
l.z = j
b.t = h
b.s = e
b.r = l
b.x = a
b.z = j
e.x = l
e.y = a
e.s = c
e.w = h
assert c.s.s.y.u.w.t.s.s.txt == "c"