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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.y: C = None
        self.p: D = None
        self.q: C = None
        self.x: C = None
        self.r: F = None
        self.z: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: E = None
        self.x: E = None
        self.s: E = None
        self.txt = txt

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

h = A("h")
f = B("f")
c = C("c")
g = D("g")
m = E("m")
d = F("d")
n = G("n")
b = B("b")
j = D("j")
k = G("k")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.y: C = None
        self.p: D = None
        self.q: C = None
        self.x: C = None
        self.r: F = None
        self.z: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: E = None
        self.x: E = None
        self.s: E = None
        self.txt = txt

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

h = A("h")
f = B("f")
c = C("c")
g = D("g")
m = E("m")
d = F("d")
n = G("n")
b = B("b")
j = D("j")
k = G("k")

h.q = b
h.r = b
h.p = m
f.s = m
f.v = m
f.t = h
f.y = n
f.w = c
f.r = d
f.x = d
c.p = g
c.y = g
c.z = d
c.w = m
c.s = b
g.o = d
m.t = k
m.y = c
m.q = c
m.x = c
m.z = c
m.p = g
m.r = d
d.y = h
d.q = m
d.x = m
d.s = m
n.v = j
b.s = m
b.v = m
b.t = h
b.y = k
b.w = c
b.r = d
b.x = d
j.o = d
k.v = j
assert g.o.x.t.v.txt == "j"