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

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

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

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

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

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

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

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

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

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

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

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

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

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

j.w = g
a.w = c
a.y = b
a.x = g
a.r = g
h.v = m
h.y = j
b.z = j
b.w = g
b.s = g
g.w = b
g.s = b
g.q = b
g.p = c
g.t = h
l.p = g
l.u = h
l.q = c
e.w = c
e.y = b
e.x = g
e.r = g
c.p = g
c.u = m
c.q = l
m.v = h
m.y = j
f.w = c
f.y = b
f.x = g
f.r = g
assert c.q.u.v.y.w.t.y.w.txt == "g"