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

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.t: C = None
        self.v: A = None
        self.q: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.o: A = None
        self.r: D = None
        self.y: D = None
        self.v: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: G = None
        self.z: C = None
        self.s: A = None
        self.o: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: B = None
        self.x: F = None
        self.txt = txt

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

j.r = h
j.o = h
j.s = h
l.w = m
l.t = h
l.v = j
l.q = n
h.z = m
h.o = j
h.r = c
h.y = c
h.v = n
c.t = m
n.o = m
n.r = m
n.x = c
n.t = c
n.s = l
n.z = h
d.x = m
d.w = m
d.z = h
d.s = j
d.o = j
m.y = l
m.w = l
m.x = d
assert d.z.r.t.x.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: C = None
        self.s: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.t: C = None
        self.v: A = None
        self.q: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.o: A = None
        self.r: D = None
        self.y: D = None
        self.v: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: G = None
        self.z: C = None
        self.s: A = None
        self.o: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: B = None
        self.x: F = None
        self.txt = txt

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

j.r = h
j.o = h
j.s = h
l.w = m
l.t = h
l.v = j
l.q = n
h.z = m
h.o = j
h.r = c
h.y = c
h.v = n
c.t = m
n.o = m
n.r = m
n.x = c
n.t = c
n.s = l
n.z = h
d.x = m
d.w = m
d.z = h
d.s = j
d.o = j
m.y = l
m.w = l
m.x = d
assert d.z.r.t.x.txt == "d"