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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: F = None
        self.u: E = None
        self.w: E = None
        self.s: C = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: A = None
        self.r: A = None
        self.t: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: B = None
        self.x: E = None
        self.txt = txt

g = A("g")
n = B("n")
k = C("k")
h = D("h")
m = E("m")
i = F("i")
l = C("l")
f = D("f")
c = A("c")

g.q = m
g.y = m
g.u = c
g.w = l
g.t = n
g.v = n
n.u = l
k.x = m
k.u = m
k.w = m
k.p = i
k.s = l
h.q = i
h.o = m
m.w = f
m.t = f
m.s = g
m.r = c
i.u = n
i.t = n
i.x = m
l.x = m
l.u = m
l.w = m
l.p = i
l.s = k
f.q = i
f.o = m
c.q = m
c.y = m
c.u = g
c.w = l
c.t = n
c.v = n
assert n.u.x.w.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.u: A = None
        self.w: C = None
        self.y: E = None
        self.t: B = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: F = None
        self.u: E = None
        self.w: E = None
        self.s: C = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: A = None
        self.r: A = None
        self.t: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: B = None
        self.x: E = None
        self.txt = txt

g = A("g")
n = B("n")
k = C("k")
h = D("h")
m = E("m")
i = F("i")
l = C("l")
f = D("f")
c = A("c")

g.q = m
g.y = m
g.u = c
g.w = l
g.t = n
g.v = n
n.u = l
k.x = m
k.u = m
k.w = m
k.p = i
k.s = l
h.q = i
h.o = m
m.w = f
m.t = f
m.s = g
m.r = c
i.u = n
i.t = n
i.x = m
l.x = m
l.u = m
l.w = m
l.p = i
l.s = k
f.q = i
f.o = m
c.q = m
c.y = m
c.u = g
c.w = l
c.t = n
c.v = n
assert n.u.x.w.txt == "f"