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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: F = None
        self.s: C = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: F = None
        self.s: C = None
        self.txt = txt

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

c.v = f
c.s = f
h.w = a
h.y = j
h.o = j
h.t = b
h.r = b
f.x = j
f.z = g
g.o = b
g.p = a
g.r = j
b.z = h
b.v = h
b.o = g
b.y = g
b.x = j
b.t = c
j.t = c
j.q = h
j.v = h
j.y = g
a.v = f
a.s = f
a.o = j
assert b.z.w.o.t.txt == "c"