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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: F = None
        self.o: B = None
        self.r: D = None
        self.q: G = None
        self.p: C = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: F = None
        self.o: B = None
        self.r: D = None
        self.q: G = None
        self.p: C = None
        self.txt = txt

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

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