class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: F = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: F = None
        self.z: E = None
        self.w: G = None
        self.txt = txt

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

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

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

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

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

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

e.u = f
e.q = l
e.v = j
j.t = d
j.r = l
j.z = h
j.w = n
f.w = n
f.o = n
f.v = n
f.r = d
d.q = j
h.p = f
h.u = f
h.v = j
h.w = d
h.x = l
h.r = e
l.r = j
l.p = f
l.o = h
l.z = d
n.s = h
n.y = d
assert e.q.z.q.z.r.q.r.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: F = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: F = None
        self.z: E = None
        self.w: G = None
        self.txt = txt

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

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

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

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

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

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

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