class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: C = None
        self.v: D = None
        self.u: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.r: E = None
        self.w: G = None
        self.txt = txt

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

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

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

c = A("c")
j = B("j")
i = C("i")
e = D("e")
g = E("g")
k = F("k")
h = G("h")
a = A("a")

c.y = e
j.w = k
j.p = i
j.u = i
j.v = e
i.r = g
e.z = h
e.w = h
e.r = g
g.p = k
g.t = k
g.o = e
g.r = e
g.z = j
g.w = h
k.u = a
k.r = a
h.z = k
h.t = k
h.y = i
a.y = e
assert k.u.y.r.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: C = None
        self.v: D = None
        self.u: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.r: E = None
        self.w: G = None
        self.txt = txt

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

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

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

c = A("c")
j = B("j")
i = C("i")
e = D("e")
g = E("g")
k = F("k")
h = G("h")
a = A("a")

c.y = e
j.w = k
j.p = i
j.u = i
j.v = e
i.r = g
e.z = h
e.w = h
e.r = g
g.p = k
g.t = k
g.o = e
g.r = e
g.z = j
g.w = h
k.u = a
k.r = a
h.z = k
h.t = k
h.y = i
a.y = e
assert k.u.y.r.txt == "g"