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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: A = None
        self.u: G = None
        self.x: A = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

a = A("a")
b = B("b")
j = C("j")
c = D("c")
l = E("l")
g = F("g")
e = G("e")
f = B("f")

a.o = g
a.w = j
b.z = j
b.r = a
b.x = a
b.u = e
j.q = l
j.o = c
c.p = j
c.o = b
c.r = b
c.w = l
l.v = j
l.z = j
l.t = e
l.u = e
l.s = e
l.p = c
l.q = c
g.o = l
g.u = a
g.s = e
e.s = f
f.z = j
f.r = a
f.x = a
f.u = e
assert c.w.z.q.p.r.u.s.txt == "
class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: A = None
        self.u: G = None
        self.x: A = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

a = A("a")
b = B("b")
j = C("j")
c = D("c")
l = E("l")
g = F("g")
e = G("e")
f = B("f")

a.o = g
a.w = j
b.z = j
b.r = a
b.x = a
b.u = e
j.q = l
j.o = c
c.p = j
c.o = b
c.r = b
c.w = l
l.v = j
l.z = j
l.t = e
l.u = e
l.s = e
l.p = c
l.q = c
g.o = l
g.u = a
g.s = e
e.s = f
f.z = j
f.r = a
f.x = a
f.u = e
assert c.w.z.q.p.r.u.s.txt == "f"