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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: C = None
        self.y: A = None
        self.u: F = None
        self.z: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: F = None
        self.w: A = None
        self.v: F = None
        self.q: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: A = None
        self.x: A = None
        self.v: F = None
        self.p: G = None
        self.o: G = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: C = None
        self.y: A = None
        self.u: F = None
        self.z: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: F = None
        self.w: A = None
        self.v: F = None
        self.q: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: A = None
        self.x: A = None
        self.v: F = None
        self.p: G = None
        self.o: G = None
        self.txt = txt

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

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

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

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