class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: A = None
        self.r: A = None
        self.u: E = None
        self.w: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: B = None
        self.s: D = None
        self.p: A = None
        self.q: B = None
        self.w: G = None
        self.y: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: F = None
        self.v: E = None
        self.z: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: B = None
        self.s: D = None
        self.p: A = None
        self.q: B = None
        self.w: G = None
        self.y: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: F = None
        self.v: E = None
        self.z: B = None
        self.txt = txt

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

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