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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: E = None
        self.x: C = None
        self.z: C = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: E = None
        self.q: C = None
        self.u: D = None
        self.s: B = None
        self.y: F = None
        self.x: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: E = None
        self.x: C = None
        self.z: C = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: E = None
        self.q: C = None
        self.u: D = None
        self.s: B = None
        self.y: F = None
        self.x: D = None
        self.txt = txt

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

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