class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.o: C = None
        self.v: F = None
        self.q: B = None
        self.z: E = None
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: F = None
        self.p: A = None
        self.w: D = None
        self.z: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: F = None
        self.o: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: F = None
        self.p: A = None
        self.w: D = None
        self.z: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: F = None
        self.o: B = None
        self.txt = txt

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

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