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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: G = None
        self.r: A = None
        self.q: B = None
        self.z: G = None
        self.o: A = None
        self.s: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: D = None
        self.p: F = None
        self.z: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: G = None
        self.r: A = None
        self.q: B = None
        self.z: G = None
        self.o: A = None
        self.s: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: D = None
        self.p: F = None
        self.z: E = None
        self.txt = txt

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

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