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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: A = None
        self.u: C = None
        self.z: F = None
        self.r: F = None
        self.s: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: D = None
        self.y: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: A = None
        self.y: E = None
        self.r: A = None
        self.s: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: A = None
        self.u: C = None
        self.z: F = None
        self.r: F = None
        self.s: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: D = None
        self.y: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: A = None
        self.y: E = None
        self.r: A = None
        self.s: D = None
        self.txt = txt

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

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