class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: E = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.z: E = None
        self.u: B = None
        self.o: F = None
        self.v: A = None
        self.q: C = None
        self.txt = txt

d = A("d")
j = B("j")
f = C("f")
b = D("b")
m = E("m")
g = F("g")
i = G("i")
c = C("c")

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.z: E = None
        self.u: B = None
        self.o: F = None
        self.v: A = None
        self.q: C = None
        self.txt = txt

d = A("d")
j = B("j")
f = C("f")
b = D("b")
m = E("m")
g = F("g")
i = G("i")
c = C("c")

d.v = c
d.z = m
j.r = b
j.y = m
f.s = c
f.u = i
f.y = j
f.x = g
b.u = j
m.u = i
m.z = c
m.r = c
m.t = j
m.v = g
g.o = m
g.p = b
g.w = i
g.r = j
i.s = d
i.v = d
i.z = m
i.u = j
i.o = g
i.q = f
c.s = f
c.u = i
c.y = j
c.x = g
assert g.r.y.u.o.w.v.txt == "d"