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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: D = None
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.x: D = None
        self.p: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: F = None
        self.w: D = None
        self.x: F = None
        self.p: F = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: D = None
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.x: D = None
        self.p: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: F = None
        self.w: D = None
        self.x: F = None
        self.p: F = None
        self.txt = txt

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

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

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

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