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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: D = None
        self.o: D = None
        self.y: D = None
        self.q: G = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: A = None
        self.txt = txt

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

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

e.y = m
e.v = g
e.r = a
a.y = e
a.s = m
j.v = d
j.s = d
d.r = e
d.p = g
d.t = a
m.u = a
m.t = d
m.o = d
m.y = d
m.q = g
m.w = e
n.p = d
n.w = e
g.v = n
g.w = n
assert j.s.r.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: G = None
        self.r: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: D = None
        self.o: D = None
        self.y: D = None
        self.q: G = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: A = None
        self.txt = txt

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

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

e.y = m
e.v = g
e.r = a
a.y = e
a.s = m
j.v = d
j.s = d
d.r = e
d.p = g
d.t = a
m.u = a
m.t = d
m.o = d
m.y = d
m.q = g
m.w = e
n.p = d
n.w = e
g.v = n
g.w = n
assert j.s.r.y.y.txt == "d"