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

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

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.o: A = None
        self.q: F = None
        self.x: B = None
        self.r: G = None
        self.t: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: A = None
        self.t: F = None
        self.r: F = None
        self.z: F = None
        self.txt = txt

n = A("n")
m = B("m")
a = C("a")
d = D("d")
e = E("e")
f = F("f")
l = G("l")

n.s = e
m.q = d
m.y = f
m.r = n
m.s = n
a.z = d
a.p = e
d.p = f
d.q = f
d.o = n
d.x = m
d.r = l
d.t = l
e.t = f
e.w = l
e.v = l
e.p = m
e.q = a
e.r = n
f.t = e
f.o = e
f.z = d
l.p = f
l.t = f
l.r = f
l.z = f
l.w = n
assert e.t.t.v.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.o: A = None
        self.q: F = None
        self.x: B = None
        self.r: G = None
        self.t: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: A = None
        self.t: F = None
        self.r: F = None
        self.z: F = None
        self.txt = txt

n = A("n")
m = B("m")
a = C("a")
d = D("d")
e = E("e")
f = F("f")
l = G("l")

n.s = e
m.q = d
m.y = f
m.r = n
m.s = n
a.z = d
a.p = e
d.p = f
d.q = f
d.o = n
d.x = m
d.r = l
d.t = l
e.t = f
e.w = l
e.v = l
e.p = m
e.q = a
e.r = n
f.t = e
f.o = e
f.z = d
l.p = f
l.t = f
l.r = f
l.z = f
l.w = n
assert e.t.t.v.txt == "l"