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

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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

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

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

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

f.v = a
f.y = b
f.x = b
f.r = l
f.w = g
g.y = f
g.q = l
b.w = g
a.u = b
a.s = f
a.q = m
a.p = m
a.w = g
a.r = g
l.w = m
l.y = g
l.q = g
l.x = h
l.u = b
h.p = f
h.q = b
h.o = b
h.t = b
h.w = g
m.t = g
m.x = h
assert f.r.y.q.q.y.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: C = None
        self.r: E = None
        self.w: B = None
        self.x: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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

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

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

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

f.v = a
f.y = b
f.x = b
f.r = l
f.w = g
g.y = f
g.q = l
b.w = g
a.u = b
a.s = f
a.q = m
a.p = m
a.w = g
a.r = g
l.w = m
l.y = g
l.q = g
l.x = h
l.u = b
h.p = f
h.q = b
h.o = b
h.t = b
h.w = g
m.t = g
m.x = h
assert f.r.y.q.q.y.v.txt == "a"