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

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

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: B = None
        self.v: C = None
        self.p: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: B = None
        self.v: C = None
        self.p: E = None
        self.txt = txt

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

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