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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: F = None
        self.o: C = None
        self.p: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: E = None
        self.z: F = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: F = None
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: D = None
        self.r: A = None
        self.u: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: F = None
        self.o: C = None
        self.p: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: E = None
        self.z: F = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: F = None
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: D = None
        self.r: A = None
        self.u: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: D = None
        self.txt = txt

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

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