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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: G = None
        self.o: A = None
        self.u: A = None
        self.w: D = None
        self.p: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: D = None
        self.w: D = None
        self.v: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: G = None
        self.o: A = None
        self.u: A = None
        self.w: D = None
        self.p: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: D = None
        self.w: D = None
        self.v: E = None
        self.txt = txt

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

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