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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: B = None
        self.w: E = None
        self.y: C = None
        self.r: E = None
        self.u: E = None
        self.z: C = None
        self.txt = txt

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

e = A("e")
b = B("b")
d = C("d")
a = D("a")
c = E("c")
n = F("n")
f = G("f")
l = B("l")
h = C("h")
k = D("k")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: B = None
        self.w: E = None
        self.y: C = None
        self.r: E = None
        self.u: E = None
        self.z: C = None
        self.txt = txt

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

e = A("e")
b = B("b")
d = C("d")
a = D("a")
c = E("c")
n = F("n")
f = G("f")
l = B("l")
h = C("h")
k = D("k")

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